1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

Prefer defcustom :local specifier

* lisp/dirtrack.el (dirtrack-list):
* lisp/emacs-lisp/lisp.el (defun-prompt-regexp):
* lisp/emulation/viper-init.el
(viper-related-files-and-buffers-ring):
* lisp/emulation/viper-util.el (viper-syntax-preference):
* lisp/erc/erc.el (erc-ignore-list):
* lisp/files.el (buffer-offer-save, backup-by-copying-when-mismatch):
* lisp/find-file.el (ff-pre-find-hook, ff-pre-load-hook)
(ff-post-load-hook, ff-not-found-hook, ff-file-created-hook)
(ff-case-fold-search, ff-always-in-other-window)
(ff-ignore-include, ff-quiet-mode, ff-other-file-alist)
(ff-search-directories):
* lisp/mh-e/mh-e.el (mh-scan-prog):
* lisp/newcomment.el (comment-column):
* lisp/obsolete/rlogin.el (rlogin-directory-tracking-mode):
* lisp/play/decipher.el (decipher-ignore-spaces):
* lisp/plstore.el (plstore-encrypt-to):
* lisp/proced.el (proced-format, proced-filter, proced-sort)
(proced-descend, proced-auto-update-flag, proced-tree-flag):
* lisp/progmodes/fortran.el (fortran-line-length):
* lisp/shell.el (shell-history-file-name):
* lisp/simple.el (goal-column, fill-prefix):
* lisp/vc/ediff-init.el (ediff-use-faces)
(ediff-highlight-all-diffs, ediff-autostore-merges):
* lisp/vc/ediff-merg.el (ediff-show-clashes-only)
(ediff-skip-merge-regions-that-differ-from-default): Prefer defcustom
:local specifier to using 'make-variable-buffer-local' directly.
This commit is contained in:
Stefan Kangas 2024-10-04 01:36:41 +02:00
parent bde00266db
commit e20ce5fcc5
18 changed files with 59 additions and 67 deletions

View File

@ -126,10 +126,9 @@ First item is a regexp that describes where to find the path in a prompt.
Second is a number, the regexp group to match."
:type '(sexp (regexp :tag "Prompt Expression")
(integer :tag "Regexp Group"))
:local t
:version "24.1")
(make-variable-buffer-local 'dirtrack-list)
(defcustom dirtrack-debug nil
"If non-nil, the function `dirtrack' will report debugging info."
:type 'boolean)

View File

@ -36,8 +36,8 @@ This is only necessary if the opening paren or brace is not in column 0.
See function `beginning-of-defun'."
:type '(choice (const nil)
regexp)
:local t
:group 'lisp)
(make-variable-buffer-local 'defun-prompt-regexp)
(defcustom parens-require-spaces t
"If non-nil, add whitespace as needed when inserting parentheses.

View File

@ -698,8 +698,8 @@ If nil, the cursor will move backwards without deleting anything."
"List of file and buffer names to consider related to the current buffer.
Related buffers can be cycled through via :R and :P commands."
:type 'boolean
:local 'permanent-only
:group 'viper-misc)
(put 'viper-related-files-and-buffers-ring 'permanent-local t)
;; Used to find out if we are done with searching the current buffer.
(defvar-local viper-local-search-start-marker nil)

View File

@ -1135,8 +1135,8 @@ This option is appropriate if you like Emacs-style words."
:type '(radio (const strict-vi) (const reformed-vi)
(const extended) (const emacs))
:set #'viper-set-syntax-preference
:local t
:group 'viper)
(make-variable-buffer-local 'viper-syntax-preference)
;; addl-chars are characters to be temporarily considered as alphanumerical

View File

@ -1106,8 +1106,8 @@ A user identifier has the form \"nick!login@host\". If an
identifier matches, the message from the person will not be
processed."
:group 'erc-ignore
:type '(repeat regexp))
(make-variable-buffer-local 'erc-ignore-list)
:type '(repeat regexp)
:local t)
(defcustom erc-ignore-reply-list nil
"List of regexps matching user identifiers to ignore completely.

View File

@ -144,8 +144,8 @@ the default for a new file created there by you.
This variable is relevant only if `backup-by-copying' is nil."
:version "24.1"
:type 'boolean
:local 'permanent-only
:group 'backup)
(put 'backup-by-copying-when-mismatch 'permanent-local t)
(defcustom backup-by-copying-when-privileged-mismatch 200
"Non-nil means create backups by copying to preserve a privileged owner.
@ -178,9 +178,8 @@ use `kill-buffer-query-functions'."
:type '(choice (const :tag "Never" nil)
(const :tag "On Emacs exit" t)
(const :tag "Whenever save-some-buffers is called" always))
:local 'permanent
:group 'backup)
(make-variable-buffer-local 'buffer-offer-save)
(put 'buffer-offer-save 'permanent-local t)
(defcustom find-file-existing-other-name t
"Non-nil means find a file under alternative names, in existing buffers.

View File

@ -130,37 +130,45 @@
(defcustom ff-pre-find-hook nil
"List of functions to be called before the search for the file starts."
:type 'hook)
:type 'hook
:local t)
(defcustom ff-pre-load-hook nil
"List of functions to be called before the other file is loaded."
:type 'hook)
:type 'hook
:local t)
(defcustom ff-post-load-hook nil
"List of functions to be called after the other file is loaded."
:type 'hook)
:type 'hook
:local t)
(defcustom ff-not-found-hook nil
"List of functions to be called if the other file could not be found."
:type 'hook)
:type 'hook
:local t)
(defcustom ff-file-created-hook nil
"List of functions to be called if the other file needs to be created."
:type 'hook)
:type 'hook
:local t)
(defcustom ff-case-fold-search nil
"Non-nil means ignore cases in matches (see `case-fold-search').
If you have extensions in different cases, you will want this to be nil."
:type 'boolean)
:type 'boolean
:local t)
(defcustom ff-always-in-other-window nil
"If non-nil, find the corresponding file in another window by default.
To override this, give an argument to `ff-find-other-file'."
:type 'boolean)
:type 'boolean
:local t)
(defcustom ff-ignore-include nil
"If non-nil, ignore `#include' lines."
:type 'boolean)
:type 'boolean
:local t)
(defcustom ff-always-try-to-create t
"If non-nil, always attempt to create the other file if it was not found."
@ -168,7 +176,8 @@ To override this, give an argument to `ff-find-other-file'."
(defcustom ff-quiet-mode nil
"If non-nil, do not trace which directories are being searched."
:type 'boolean)
:type 'boolean
:local t)
;;;###autoload
(defcustom ff-special-constructs
@ -220,7 +229,8 @@ function must return a non-nil list of file-names. It cannot
return nil, nor can it signal in any way a failure to find a suitable
list of file names."
:type '(choice (repeat (list regexp (choice (repeat string) function)))
symbol))
symbol)
:local t)
(defcustom ff-search-directories 'cc-search-directories
"List of directories to search for a specific file.
@ -243,7 +253,8 @@ not exist, it is replaced (silently) with an empty string.
The stars are *not* wildcards: they are searched for together with
the preceding slash. The star represents all the subdirectories except
`..', and each of these subdirectories will be searched in turn."
:type '(choice (repeat directory) symbol))
:type '(choice (repeat directory) symbol)
:local t)
(defcustom cc-search-directories
'("." "/usr/include" "/usr/local/include/*")
@ -294,17 +305,6 @@ is created with the first matching extension (`.cc' yields `.hh')."
;; No user definable variables beyond this point!
;; ==============================================
(make-variable-buffer-local 'ff-pre-find-hook)
(make-variable-buffer-local 'ff-pre-load-hook)
(make-variable-buffer-local 'ff-post-load-hook)
(make-variable-buffer-local 'ff-not-found-hook)
(make-variable-buffer-local 'ff-file-created-hook)
(make-variable-buffer-local 'ff-case-fold-search)
(make-variable-buffer-local 'ff-always-in-other-window)
(make-variable-buffer-local 'ff-ignore-include)
(make-variable-buffer-local 'ff-quiet-mode)
(make-variable-buffer-local 'ff-other-file-alist)
(make-variable-buffer-local 'ff-search-directories)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; User entry points

View File

@ -2008,9 +2008,9 @@ absolute pathname, it is assumed to be in the `mh-progs'
directory. You may link another program to `scan' (see
\"mh-profile(5)\") to produce a different type of listing."
:type 'string
:local t
:group 'mh-scan-line-formats
:package-version '(MH-E . "6.0"))
(make-variable-buffer-local 'mh-scan-prog)
;;; Searching (:group 'mh-search)

View File

@ -109,8 +109,8 @@ can set the value for a particular mode using that mode's hook.
Comments might be indented to a different value in order not to go beyond
`comment-fill-column' or in order to align them with surrounding comments."
:type 'integer
:local t
:group 'comment)
(make-variable-buffer-local 'comment-column)
;;;###autoload
(put 'comment-column 'safe-local-variable 'integerp)

View File

@ -99,10 +99,9 @@ re-syncing of directories."
:type '(choice (const :tag "off" nil)
(const :tag "ftp" t)
(other :tag "local" local))
:local t
:group 'rlogin)
(make-variable-buffer-local 'rlogin-directory-tracking-mode)
(defcustom rlogin-host nil
"The name of the default remote host. This variable is buffer-local."
:type '(choice (const nil) string)

View File

@ -109,8 +109,8 @@ This variable must be set before typing `\\[decipher]'."
You should set this to nil if the cipher message is divided into words,
or t if it is not.
This variable is buffer-local."
:type 'boolean)
(make-variable-buffer-local 'decipher-ignore-spaces)
:type 'boolean
:local t)
(defcustom decipher-undo-limit 5000
"The maximum number of entries in the undo list.

View File

@ -236,6 +236,7 @@ If neither t nor nil, doesn't ask user."
May either be a string or a list of strings. If it is nil,
symmetric encryption will be used."
:type '(choice (const nil) (repeat :tag "Recipient(s)" string))
:local 'permanent-only
:group 'plstore)
;;;###autoload
@ -250,7 +251,6 @@ symmetric encryption will be used."
val)
t)))))
(put 'plstore-encrypt-to 'permanent-local t)
(defvar plstore-encoded nil
"Non-nil if the current buffer shows the decoded alist.") ; [sic!]

View File

@ -289,8 +289,8 @@ one, etc."
It can be the car of an element of `proced-format-alist'.
It can also be a list of keys appearing in `proced-grammar-alist'."
:type '(choice (symbol :tag "Format Name")
(repeat :tag "Keys" (symbol :tag ""))))
(make-variable-buffer-local 'proced-format)
(repeat :tag "Keys" (symbol :tag "")))
:local t)
;; FIXME: is there a better name for filter `user' that does not coincide
;; with an attribute key?
@ -335,8 +335,8 @@ of `proced-filter-alist'."
(choice (cons :tag "Key . Regexp" (symbol :tag "Key") regexp)
(cons :tag "Key . Function" (symbol :tag "Key") function)
(cons :tag "Function" (const :tag "Key: function" function) function)
(cons :tag "Fun-all" (const :tag "Key: fun-all" fun-all) function)))))
(make-variable-buffer-local 'proced-filter)
(cons :tag "Fun-all" (const :tag "Key: fun-all" fun-all) function))))
:local t)
(defcustom proced-sort 'pcpu
"Current sort scheme for proced listing.
@ -344,13 +344,13 @@ It must be the KEY of an element of `proced-grammar-alist'.
It can also be a list of KEYs as in the SORT-SCHEMEs of the elements
of `proced-grammar-alist'."
:type '(choice (symbol :tag "Sort Scheme")
(repeat :tag "Key List" (symbol :tag "Key"))))
(make-variable-buffer-local 'proced-sort)
(repeat :tag "Key List" (symbol :tag "Key")))
:local t)
(defcustom proced-descend t
"Non-nil if proced listing is sorted in descending order."
:type '(boolean :tag "Descending Sort Order"))
(make-variable-buffer-local 'proced-descend)
:type '(boolean :tag "Descending Sort Order")
:local t)
(defcustom proced-goal-attribute 'args
"If non-nil, key of the attribute that defines the `goal-column'."
@ -368,13 +368,13 @@ displayed in a window. Can be changed interactively via
`proced-toggle-auto-update'."
:type '(radio (const :tag "Don't auto update" nil)
(const :tag "Only update visible proced buffers" visible)
(const :tag "Update all proced buffers" t)))
(make-variable-buffer-local 'proced-auto-update-flag)
(const :tag "Update all proced buffers" t))
:local t)
(defcustom proced-tree-flag nil
"Non-nil for display of Proced buffer as process tree."
:type 'boolean)
(make-variable-buffer-local 'proced-tree-flag)
:type 'boolean
:local t)
(defcustom proced-post-display-hook nil
"Normal hook run after displaying or updating a Proced buffer.

View File

@ -290,6 +290,7 @@ buffer). This corresponds to the g77 compiler option
`-ffixed-line-length-N'."
:type 'integer
:safe 'integerp
:local t
:initialize 'custom-initialize-default
:set (lambda (_symbol value)
;; Do all fortran buffers, and the default.
@ -297,8 +298,6 @@ buffer). This corresponds to the g77 compiler option
:version "23.1"
:group 'fortran)
(make-variable-buffer-local 'fortran-line-length)
(defcustom fortran-mode-hook nil
"Hook run when entering Fortran mode."
:type 'hook

View File

@ -432,8 +432,8 @@ interpreted as local file name on the remote host.
If `shell-mode' is invoked in a local buffer, and no history file name
can be determined, a default according to the shell type is used."
:type '(choice (const :tag "Default" nil) (const :tag "Suppress" t) file)
:local 'permanent-only
:version "30.1")
(put 'shell-history-file-name 'permanent-local t)
;;; Basic Procedures

View File

@ -7704,8 +7704,8 @@ This has no effect when the variable `line-move-visual' is non-nil."
A non-nil setting overrides the variable `line-move-visual', which see."
:type '(choice integer
(const :tag "None" nil))
:local t
:group 'editing-basics)
(make-variable-buffer-local 'goal-column)
(defvar temporary-goal-column 0
"Current goal column for vertical motion.
@ -8989,8 +8989,8 @@ treated as delimiting words. See this command's namesake in Info node
:type '(choice (const :tag "None" nil)
string)
:safe #'string-or-null-p
:local t
:group 'fill)
(make-variable-buffer-local 'fill-prefix)
(defcustom auto-fill-inhibit-regexp nil
"Regexp to match lines that should not be auto-filled."

View File

@ -567,9 +567,8 @@ If nil, differences are highlighted using ASCII flags, ediff-before-flag
and ediff-after-flag. On a non-window system, differences are always
highlighted using ASCII flags."
:type 'boolean
:local 'permanent
:group 'ediff-highlighting)
(make-variable-buffer-local 'ediff-use-faces)
(put 'ediff-use-faces 'permanent-local t)
;; this indicates that diff regions are word-size, so fine diffs are
;; permanently nixed; used in ediff-windows-wordwise and ediff-regions-wordwise
@ -611,9 +610,8 @@ reverses the meaning of this variable."
Otherwise, all difference regions are highlighted, but the selected region is
shown in brighter colors."
:type 'boolean
:local 'permanent
:group 'ediff-highlighting)
(make-variable-buffer-local 'ediff-highlight-all-diffs)
(put 'ediff-highlight-all-diffs 'permanent-local t)
(ediff-defvar-local ediff-control-buffer-suffix nil
@ -1200,8 +1198,8 @@ save. Anything else means save automatically only if the merge
job is part of a group of jobs, such as `ediff-merge-directory'
or `ediff-merge-directory-revisions'."
:type '(choice (const nil) (const t) (const group-jobs-only))
:local t
:group 'ediff-merge)
(make-variable-buffer-local 'ediff-autostore-merges)
(ediff-defvar-local ediff-merge-store-file nil
"File where the result of the merge is to be saved. Internal.")

View File

@ -73,9 +73,8 @@ STRING4"
This means that regions that have status prefer-A or prefer-B will be
skipped over. A value of nil means show all regions."
:type 'boolean
:group 'ediff-merge
)
(make-variable-buffer-local 'ediff-show-clashes-only)
:local t
:group 'ediff-merge)
(defcustom ediff-skip-merge-regions-that-differ-from-default nil
"If t, show only the regions that have not been changed by the user.
@ -87,9 +86,8 @@ A region is considered to have been changed also when it is marked as
Buffer A or if it is marked as `prefer-B' and is different from the region in
Buffer B."
:type 'boolean
:group 'ediff-merge
)
(make-variable-buffer-local 'ediff-skip-merge-regions-that-differ-from-default)
:local t
:group 'ediff-merge)
(defvar state-of-merge) ; dynamic var