mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-11 16:08:13 +00:00
Fix marking "delayed-initialization" vars as dynamically scoped
We used to mark those vars as dynbound in `custom-reevaluate-setting` which forced us to bind `current-load-list` around it to avoid having the vars be associated with the wrong file. Move this marking to `custom-initialize-delay` so we don't need this workaround. * lisp/custom.el (custom-initialize-delay): Mark the var as dynamic. (custom-reevaluate-setting): Don't use `defvar` here. * lisp/startup.el (command-line): Don't let-bind `current-load-list` around calls to `custom-reevaluate-setting`.
This commit is contained in:
parent
53514e77a5
commit
5039f79340
@ -136,6 +136,9 @@ to include all of it." ; see eg vc-sccs-search-project-dir
|
||||
;; No longer true:
|
||||
;; "See `send-mail-function' in sendmail.el for an example."
|
||||
|
||||
;; Defvar it so as to mark it special, etc (bug#25770).
|
||||
(internal--define-uninitialized-variable symbol)
|
||||
|
||||
;; Until the var is actually initialized, it is kept unbound.
|
||||
;; This seemed to be at least as good as setting it to an arbitrary
|
||||
;; value like nil (evaluating `value' is not an option because it
|
||||
@ -780,8 +783,7 @@ Return non-nil if the `customized-value' property actually changed."
|
||||
Use the :set function to do so. This is useful for customizable options
|
||||
that are defined before their standard value can really be computed.
|
||||
E.g. dumped variables whose default depends on run-time information."
|
||||
;; If it has never been set at all, defvar it so as to mark it
|
||||
;; special, etc (bug#25770). This means we are initializing
|
||||
;; We are initializing
|
||||
;; the variable, and normally any :set function would not apply.
|
||||
;; For custom-initialize-delay, however, it is documented that "the
|
||||
;; (delayed) initialization is performed with the :set function".
|
||||
@ -789,11 +791,10 @@ E.g. dumped variables whose default depends on run-time information."
|
||||
;; custom-initialize-delay but needs the :set function custom-set-minor-mode
|
||||
;; to also run during initialization. So, long story short, we
|
||||
;; always do the funcall step, even if symbol was not bound before.
|
||||
(or (default-boundp symbol)
|
||||
(eval `(defvar ,symbol nil))) ; reset below, so any value is fine
|
||||
(funcall (or (get symbol 'custom-set) #'set-default)
|
||||
symbol
|
||||
(eval (car (or (get symbol 'saved-value) (get symbol 'standard-value))))))
|
||||
(eval (car (or (get symbol 'saved-value)
|
||||
(get symbol 'standard-value))))))
|
||||
|
||||
|
||||
;;; Custom Themes
|
||||
|
@ -1167,12 +1167,11 @@ please check its value")
|
||||
|
||||
;; Re-evaluate predefined variables whose initial value depends on
|
||||
;; the runtime context.
|
||||
(let (current-load-list) ; c-r-s may call defvar, and hence LOADHIST_ATTACH
|
||||
(setq custom-delayed-init-variables
|
||||
;; Initialize them in the same order they were loaded, in case there
|
||||
;; are dependencies between them.
|
||||
(nreverse custom-delayed-init-variables))
|
||||
(mapc 'custom-reevaluate-setting custom-delayed-init-variables))
|
||||
(setq custom-delayed-init-variables
|
||||
;; Initialize them in the same order they were loaded, in case there
|
||||
;; are dependencies between them.
|
||||
(nreverse custom-delayed-init-variables))
|
||||
(mapc #'custom-reevaluate-setting custom-delayed-init-variables)
|
||||
|
||||
;; Warn for invalid user name.
|
||||
(when init-file-user
|
||||
@ -1315,9 +1314,8 @@ please check its value")
|
||||
;; Re-evaluate again the predefined variables whose initial value
|
||||
;; depends on the runtime context, in case some of them depend on
|
||||
;; the window-system features. Example: blink-cursor-mode.
|
||||
(let (current-load-list) ; c-r-s may call defvar, and hence LOADHIST_ATTACH
|
||||
(mapc 'custom-reevaluate-setting custom-delayed-init-variables)
|
||||
(setq custom-delayed-init-variables nil))
|
||||
(mapc #'custom-reevaluate-setting custom-delayed-init-variables)
|
||||
(setq custom-delayed-init-variables nil)
|
||||
|
||||
(normal-erase-is-backspace-setup-frame)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user