changeset 50123:7c924263658d

(custom-set-minor-mode): New fun.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 13 Mar 2003 18:10:41 +0000
parents cfcc62c9e7df
children d4f965eb8fd5
files lisp/custom.el
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/custom.el	Thu Mar 13 11:38:35 2003 +0000
+++ b/lisp/custom.el	Thu Mar 13 18:10:41 2003 +0000
@@ -797,6 +797,17 @@
 	(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))