Commit e3b70e6b authored by Juanma Barranquero's avatar Juanma Barranquero Committed by Lars Ingebrigtsen

Add :local specifier to defcustom

* lisp/custom.el (custom-declare-variable): Allow the new :local
parameter (bug#14591).
(defcustom): Document it.
parent 1d9bb2ff
......@@ -1790,6 +1790,11 @@ valid event type.
* Lisp Changes in Emacs 27.1
** defcustom now takes a :local keyword that can be either t or
`permanent', which mean that the variable should be automatically
buffer-local. `permanent' also sets the variable's
`permanent-local' property.
** The new macro `with-suppressed-warnings' can be used to suppress
specific byte-compile warnings.
......@@ -181,6 +181,11 @@ set to nil, as the value is no longer rogue."
(put symbol 'risky-local-variable value))
((eq keyword :safe)
(put symbol 'safe-local-variable value))
((eq keyword :local)
(when (memq value '(t permanent))
(make-variable-buffer-local symbol))
(when (eq value 'permanent)
(put symbol 'permanent-local t)))
((eq keyword :type)
(put symbol 'custom-type (purecopy value)))
((eq keyword :options)
......@@ -251,6 +256,9 @@ The following keywords are meaningful:
:risky Set SYMBOL's `risky-local-variable' property to VALUE.
:safe Set SYMBOL's `safe-local-variable' property to VALUE.
See Info node `(elisp) File Local Variables'.
:local If VALUE is t, mark SYMBOL as automatically buffer-local.
If VALUE is `permanent', also set SYMBOL's `permanent-local'
property to t.
The following common keywords are also meaningful.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment