1
Fork 0
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:
Stefan Monnier 2025-10-29 14:34:59 -04:00
parent 96cde6cdd4
commit 905f3d0a8a

View file

@ -771,10 +771,16 @@ 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 (if value 1 0)))
(funcall variable (if value 1 0))))
(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)))))
(defun custom-quote (sexp)
"Quote SEXP if it is not self quoting."