mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-05 22:20:24 -08:00
lisp/custom.el (custom-set-minor-mode): Load the mode more lazily
This commit is contained in:
parent
96cde6cdd4
commit
905f3d0a8a
1 changed files with 10 additions and 4 deletions
|
|
@ -771,10 +771,16 @@ Normally, this sets the default value of VARIABLE to nil if VALUE
|
||||||
is nil and to t otherwise,
|
is nil and to t otherwise,
|
||||||
but if `custom-local-buffer' is non-nil,
|
but if `custom-local-buffer' is non-nil,
|
||||||
this sets the local binding in that buffer instead."
|
this sets the local binding in that buffer instead."
|
||||||
(if custom-local-buffer
|
(if (and (null value)
|
||||||
(with-current-buffer custom-local-buffer
|
(autoloadp (symbol-function variable))
|
||||||
(funcall variable (if value 1 0)))
|
(not (and (boundp variable) (symbol-value variable))))
|
||||||
(funcall variable (if value 1 0))))
|
;; 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)))))
|
||||||
|
|
||||||
(defun custom-quote (sexp)
|
(defun custom-quote (sexp)
|
||||||
"Quote SEXP if it is not self quoting."
|
"Quote SEXP if it is not self quoting."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue