diff options
| author | Stefan Monnier | 2024-05-16 09:50:39 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2024-05-16 09:50:39 -0400 |
| commit | ee3ef57c24fe3435cd896e1f096aadff5f9372a0 (patch) | |
| tree | 29a2d2e4fdc6428d79c6b73deb9439d552fe5dca | |
| parent | cdf49336cd06c433d2aa7795672aebe413c92f54 (diff) | |
| download | emacs-ee3ef57c24fe3435cd896e1f096aadff5f9372a0.tar.gz emacs-ee3ef57c24fe3435cd896e1f096aadff5f9372a0.zip | |
* lisp/loadup.el: Add workaround for occasional "bootstrap" failure
| -rw-r--r-- | lisp/loadup.el | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/loadup.el b/lisp/loadup.el index c6a8dcbb909..aab1231c8be 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el | |||
| @@ -191,6 +191,23 @@ | |||
| 191 | (setq definition-prefixes new)) | 191 | (setq definition-prefixes new)) |
| 192 | 192 | ||
| 193 | (load "button") ;After loaddefs, because of define-minor-mode! | 193 | (load "button") ;After loaddefs, because of define-minor-mode! |
| 194 | |||
| 195 | (when (interpreted-function-p (symbol-function 'add-hook)) | ||
| 196 | ;; `subr.el' is needed early and hence can't use macros like `setf' | ||
| 197 | ;; liberally. Yet, it does use such macros in code that it knows will not | ||
| 198 | ;; be executed too early, such as `add-hook'. Usually, by the time we | ||
| 199 | ;; run that code, either `subr.el' was already compiled to start with | ||
| 200 | ;; or on the contrary many files aren't compiled yet and have thus caused | ||
| 201 | ;; macro packages like `gv' to be loaded. But not always. | ||
| 202 | ;; The specific error we're trying to work around, here, occurs when | ||
| 203 | ;; `cl-preloaded's `provide' ends up (because of an `eval-after-load') | ||
| 204 | ;; calling `add-hook' which burps with a "void-function setf" on | ||
| 205 | ;; (setf (get hook 'hook--depth-alist) depth-sym)'. | ||
| 206 | ;; FIXME: We should probably split `subr.el' into one that's loaded early | ||
| 207 | ;; where we refrain from using macros like `setf', and another loaded later | ||
| 208 | ;; where we can blissfully `require' packages like `gv'. | ||
| 209 | (require 'gv)) | ||
| 210 | |||
| 194 | (load "emacs-lisp/cl-preloaded") | 211 | (load "emacs-lisp/cl-preloaded") |
| 195 | (load "emacs-lisp/oclosure") ;Used by cl-generic | 212 | (load "emacs-lisp/oclosure") ;Used by cl-generic |
| 196 | (load "obarray") ;abbrev.el is implemented in terms of obarrays. | 213 | (load "obarray") ;abbrev.el is implemented in terms of obarrays. |