Function: custom-set-minor-mode

custom-set-minor-mode is a byte-compiled function defined in custom.el.gz.

Signature

(custom-set-minor-mode VARIABLE VALUE)

Documentation

: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.

Source Code

;; Defined in /usr/src/emacs/lisp/custom.el.gz
(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 (and (null value)
           (autoloadp (symbol-function variable))
           (not (and (boundp variable) (symbol-value variable))))
      ;; We're disabling a minor mode that's not even loaded yet.
      ;; Let's avoid autoloading it needlessly.
      (custom-set-default variable value)
    (if custom-local-buffer
	(with-current-buffer custom-local-buffer
	  (funcall variable (if value 1 0)))
      (funcall variable (if value 1 0)))))