summaryrefslogtreecommitdiff
path: root/lisp/custom.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2003-03-13 18:10:41 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2003-03-13 18:10:41 +0000
commitdf380962210bb5f655f9ad80b38e88a8254b6b61 (patch)
treeba387ddb6b4ee51a7596a2940d3c548243ccdbb1 /lisp/custom.el
parent20b853f3c9cc117cd90d54a4c097a0b45f1605c3 (diff)
downloademacs-df380962210bb5f655f9ad80b38e88a8254b6b61.tar.gz
(custom-set-minor-mode): New fun.
Diffstat (limited to 'lisp/custom.el')
-rw-r--r--lisp/custom.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index 8ed78fd649d..bcec5904fd8 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -797,6 +797,17 @@ this sets the local binding in that buffer instead."
(set variable value))
(set-default variable value)))
+(defun custom-set-minor-mode (variable value)
+ ":set function for minor mode variables.
+Normally, this sets the default value of VARIABLE to nil if VALUE
+is nil and to t otherwise,
+but if `custom-local-buffer' is non-nil,
+this sets the local binding in that buffer instead."
+ (if custom-local-buffer
+ (with-current-buffer custom-local-buffer
+ (funcall variable (or value 0)))
+ (funcall variable (or value 0))))
+
(defun custom-quote (sexp)
"Quote SEXP iff it is not self quoting."
(if (or (memq sexp '(t nil))