mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
Add :local specifier to defcustom
* lisp/custom.el (custom-declare-variable): Allow the new :local parameter (bug#14591). (defcustom): Document it.
This commit is contained in:
parent
1d9bb2ff70
commit
e3b70e6b2d
2 changed files with 13 additions and 0 deletions
5
etc/NEWS
5
etc/NEWS
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue