]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer defvar-local in vc/*.el
authorStefan Kangas <stefan@marxist.se>
Sun, 31 Jan 2021 15:27:26 +0000 (16:27 +0100)
committerStefan Kangas <stefan@marxist.se>
Sun, 31 Jan 2021 19:08:25 +0000 (20:08 +0100)
* lisp/vc/ediff-diff.el (ediff-whitespace, ediff-word-1)
(ediff-word-2, ediff-word-3, ediff-word-4):
* lisp/vc/ediff-init.el (ediff-defvar-local):
* lisp/vc/smerge-mode.el (smerge-check-cache):
* lisp/vc/vc-bzr.el (vc-bzr-annotation-table):
* lisp/vc/vc-dispatcher.el (vc-mode-line-hook): Prefer defvar-local.

lisp/vc/ediff-diff.el
lisp/vc/ediff-init.el
lisp/vc/smerge-mode.el
lisp/vc/vc-bzr.el
lisp/vc/vc-dispatcher.el

index e90eaa11565f42bfea4f5059d549d0aa29628d85..fde9d4338f3dda233042f628ad6a5717e4ba43b1 100644 (file)
@@ -1230,35 +1230,30 @@ are ignored."
 Used for splitting difference regions into individual words.")
 
 ;; \240 is Unicode symbol for nonbreakable whitespace
-(defvar ediff-whitespace " \n\t\f\r\240"
+(defvar-local ediff-whitespace " \n\t\f\r\240"
   "Characters constituting white space.
 These characters are ignored when differing regions are split into words.")
-(make-variable-buffer-local 'ediff-whitespace)
 
-(defvar ediff-word-1 "-[:word:]_"
+(defvar-local ediff-word-1 "-[:word:]_"
   "Characters that constitute words of type 1.
 More precisely, [ediff-word-1] is a regexp that matches type 1 words.
 See `ediff-forward-word' for more details.")
-(make-variable-buffer-local 'ediff-word-1)
 
-(defvar ediff-word-2 "0-9.,"
+(defvar-local ediff-word-2 "0-9.,"
   "Characters that constitute words of type 2.
 More precisely, [ediff-word-2] is a regexp that matches type 2 words.
 See `ediff-forward-word' for more details.")
-(make-variable-buffer-local 'ediff-word-2)
 
-(defvar ediff-word-3 "`'?!:;\"{}[]()"
+(defvar-local ediff-word-3 "`'?!:;\"{}[]()"
   "Characters that constitute words of type 3.
 More precisely, [ediff-word-3] is a regexp that matches type 3 words.
 See `ediff-forward-word' for more details.")
-(make-variable-buffer-local 'ediff-word-3)
 
-(defvar ediff-word-4
+(defvar-local ediff-word-4
   (concat "^" ediff-word-1 ediff-word-2 ediff-word-3 ediff-whitespace)
   "Characters that constitute words of type 4.
 More precisely, [ediff-word-4] is a regexp that matches type 4 words.
 See `ediff-forward-word' for more details.")
-(make-variable-buffer-local 'ediff-word-4)
 
 ;; Split region along word boundaries. Each word will be on its own line.
 ;; Output to buffer out-buffer.
index 0865ac5ce41377f9f236a849ec402df6ab6c149a..c20d03c83d67b22eb7522eaf762d08adadda803a 100644 (file)
@@ -80,13 +80,12 @@ that Ediff doesn't know about.")
 ;; so that `kill-all-local-variables' (called by major-mode setting
 ;; commands) won't destroy Ediff control variables.
 ;;
-;; Plagiarized from `emerge-defvar-local' for XEmacs.
+;; Plagiarized from `emerge-defvar-local'.
 (defmacro ediff-defvar-local (var value doc)
   "Defines VAR as a local variable."
   (declare (indent defun) (doc-string 3))
   `(progn
-     (defvar ,var ,value ,doc)
-     (make-variable-buffer-local ',var)
+     (defvar-local ,var ,value ,doc)
      (put ',var 'permanent-local t)))
 
 
index 3b09dfe5d2e5ac0830980499f7d32c6b5fc61278..f50b2540c55bb2d8a8d5858055701cc3deca9972 100644 (file)
@@ -173,8 +173,7 @@ Used in `smerge-diff-base-upper' and related functions."
   `((,smerge-command-prefix . ,smerge-basic-map))
   "Keymap for `smerge-mode'.")
 
-(defvar smerge-check-cache nil)
-(make-variable-buffer-local 'smerge-check-cache)
+(defvar-local smerge-check-cache nil)
 (defun smerge-check (n)
   (condition-case nil
       (let ((state (cons (point) (buffer-modified-tick))))
index e4eff486f5e48f7f958f8ff23e6f8fde17896101..c495afb6ec5def9a4a78ac1439d10f1cb967a543 100644 (file)
@@ -860,9 +860,8 @@ If LIMIT is non-nil, show no more than this many entries."
   (vc-bzr-command "mv" nil 0 new old)
   (message "Renamed %s => %s" old new))
 
-(defvar vc-bzr-annotation-table nil
+(defvar-local vc-bzr-annotation-table nil
   "Internal use.")
-(make-variable-buffer-local 'vc-bzr-annotation-table)
 
 (defun vc-bzr-annotate-command (file buffer &optional revision)
   "Prepare BUFFER for `vc-annotate' on FILE.
index 6b17f2afe744ccabf40f0b65f15be651ca8895d0..2573964c42c7df7fa3a2e1a10cd55631b12f9d51 100644 (file)
@@ -531,8 +531,7 @@ ARG and NO-CONFIRM are passed on to `revert-buffer'."
       (revert-buffer arg no-confirm t))
     (vc-restore-buffer-context context)))
 
-(defvar vc-mode-line-hook nil)
-(make-variable-buffer-local 'vc-mode-line-hook)
+(defvar-local vc-mode-line-hook nil)
 (put 'vc-mode-line-hook 'permanent-local t)
 
 (defvar view-old-buffer-read-only)