1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

Prefer defcustom :local specifier in textmodes

* lisp/textmodes/fill.el (default-justification):
* lisp/textmodes/ispell.el (ispell-local-dictionary)
(ispell-skip-html):
* lisp/textmodes/less-css-mode.el (less-css-output-file-name)
(less-css-input-file-name):
* lisp/textmodes/refer.el (refer-bib-directory, refer-bib-files)
(refer-cache-bib-files):
* lisp/textmodes/two-column.el (2C-separator, 2C-window-width):
Prefer defcustom :local specifier to using 'make-variable-buffer-local'
directly.
This commit is contained in:
Stefan Kangas 2024-10-02 12:19:22 +02:00
parent 67e807d897
commit 4bb62af326
5 changed files with 20 additions and 25 deletions

View File

@ -1115,9 +1115,9 @@ The `justification' text-property can locally override this variable."
(const right)
(const full)
(const center)
(const none))
(const none))
:local t
:safe 'symbolp)
(make-variable-buffer-local 'default-justification)
(defun current-justification ()
"How should we justify this line?

View File

@ -346,12 +346,11 @@ calling \\[ispell-change-dictionary] with that value. This variable
is automatically set when defined in the file with either
`ispell-dictionary-keyword' or the Local Variable syntax."
:type '(choice string
(const :tag "default" nil)))
(const :tag "default" nil))
:local t)
;;;###autoload
(put 'ispell-local-dictionary 'safe-local-variable 'string-or-null-p)
(make-variable-buffer-local 'ispell-local-dictionary)
(defcustom ispell-dictionary nil
"Default dictionary to use if `ispell-local-dictionary' is nil."
:type '(choice string
@ -377,10 +376,8 @@ such as \"&\". See `ispell-html-skip-alists' for more details.
This variable affects spell-checking of HTML, XML, and SGML files."
:type '(choice (const :tag "always" t) (const :tag "never" nil)
(const :tag "use-mode-name" use-mode-name)))
(make-variable-buffer-local 'ispell-skip-html)
(const :tag "use-mode-name" use-mode-name))
:local t)
(defcustom ispell-local-dictionary-alist nil
"List of local or customized dictionary definitions.

View File

@ -115,8 +115,8 @@ This can be also be set to a full path, or a relative path. If
the path is relative, it will be relative to the value of
`less-css-output-dir', if set, or the current directory by
default."
:type '(choice (const :tag "Default" nil) file))
(make-variable-buffer-local 'less-css-output-file-name)
:type '(choice (const :tag "Default" nil) file)
:local t)
(defcustom less-css-input-file-name nil
"File name which will be compiled to CSS.
@ -131,10 +131,10 @@ variables.
This can be also be set to a full path, or a relative path. If
the path is relative, it will be relative to the current
directory by default."
:type '(choice (const nil) file))
:type '(choice (const nil) file)
:local t)
;;;###autoload
(put 'less-css-input-file-name 'safe-local-variable #'stringp)
(make-variable-buffer-local 'less-css-input-file-name)
(defconst less-css-default-error-regex
"^\\(?:\e\\[31m\\)?\\([^\e\n]*\\|FileError:.*\n\\)\\(?:\e\\[39m\e\\[31m\\)? in \\(?:\e\\[39m\\)?\\([^ \r\n\t\e]+\\)\\(?:\e\\[90m\\)?\\(?::\\| on line \\)\\([0-9]+\\)\\(?::\\|, column \\)\\([0-9]+\\):?\\(?:\e\\[39m\\)?")

View File

@ -91,7 +91,8 @@ the default search path. Since Refer does not know that default path,
it cannot search it. Include that path explicitly in your BIBINPUTS
environment if you really want it searched (which is not likely to
happen anyway)."
:type '(choice (repeat directory) (const bibinputs) (const texinputs)))
:type '(choice (repeat directory) (const bibinputs) (const texinputs))
:local t)
(defcustom refer-bib-files 'dir
"List of \\.bib files to search for references,
@ -109,14 +110,16 @@ If `refer-bib-files' is nil, auto or dir, it is setq'd to the appropriate
list of files when it is first used if `refer-cache-bib-files' is t. If
`refer-cache-bib-files' is nil, the list of \\.bib files to use is re-read
each time it is needed."
:type '(choice (repeat file) (const nil) (const auto) (const dir)))
:type '(choice (repeat file) (const nil) (const auto) (const dir))
:local t)
(defcustom refer-cache-bib-files t
"Variable determining whether the value of `refer-bib-files' should be cached.
If t, initialize the value of refer-bib-files the first time it is used.
If nil, re-read the list of \\.bib files depending on the value of
`refer-bib-files' each time it is needed."
:type 'boolean)
:type 'boolean
:local t)
(defcustom refer-bib-files-regexp "\\\\bibliography"
"Regexp matching a bibliography file declaration.
@ -130,10 +133,6 @@ If a specified file doesn't exist and has no extension, a \\.bib extension
is automatically tried."
:type 'regexp)
(make-variable-buffer-local 'refer-bib-files)
(make-variable-buffer-local 'refer-cache-bib-files)
(make-variable-buffer-local 'refer-bib-directory)
;;; Internal variables
(defvar refer-saved-state nil)
(defvar refer-previous-keywords nil)

View File

@ -142,15 +142,14 @@
(defcustom 2C-separator ""
"A string inserted between the two columns when merging.
This gets set locally by \\[2C-split]."
:type 'string)
(put '2C-separator 'permanent-local t)
:type 'string
:local 'permanent-only)
(defcustom 2C-window-width 40
"The width of the first column. (Must be at least `window-min-width'.)
This value is local for every buffer that sets it."
:type 'integer)
(make-variable-buffer-local '2C-window-width)
(put '2C-window-width 'permanent-local t)
:type 'integer
:local 'permanent)
(defcustom 2C-beyond-fill-column 4
"Base for calculating `fill-column' for a buffer in two-column minor mode.