summaryrefslogtreecommitdiff
path: root/lisp/custom.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2019-06-27 13:26:45 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-06-27 13:26:45 +0200
commite3b70e6b2dc5805fa92c9ddbf42fed81ed835f1b (patch)
tree8c7284ea70fb42c0eb0b9ef2c38faedc668e0f71 /lisp/custom.el
parent1d9bb2ff70ca65dbfdd2ec904b8f6d9e07a6e9c5 (diff)
downloademacs-e3b70e6b2dc5805fa92c9ddbf42fed81ed835f1b.tar.gz
Add :local specifier to defcustom
* lisp/custom.el (custom-declare-variable): Allow the new :local parameter (bug#14591). (defcustom): Document it.
Diffstat (limited to 'lisp/custom.el')
-rw-r--r--lisp/custom.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index 29bf9e570a8..736460fec7b 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -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.