diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-16 04:15:32 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-16 04:15:32 -0500 |
| commit | 7c68b0add908294a0d0c4e9f538e1066ab68918c (patch) | |
| tree | dbfd3f448d50e85a60d7f28be479449c27d23926 /modules | |
| parent | 01d1010338bca29091d722e635ab96e62e679765 (diff) | |
| download | dotemacs-7c68b0add908294a0d0c4e9f538e1066ab68918c.tar.gz dotemacs-7c68b0add908294a0d0c4e9f538e1066ab68918c.zip | |
fix(nerd-icons): restore `:demand t' so dashboard-config can load
Commit 70c4e127's defer change broke startup with a `void-function
nerd-icons-faicon' error. `dashboard-config.el' calls
`nerd-icons-faicon' / `nerd-icons-mdicon' / `nerd-icons-devicon' at
load time to build `dashboard-navigator-buttons', so nerd-icons must
be loaded eagerly before dashboard-config requires. The "defer for
batch and headless" intent doesn't hold here -- dashboard loads
unconditionally at startup, so nerd-icons does too either way.
Kept the `with-eval-after-load 'nerd-icons' safety net for the
re-evaluation case (advice still attaches if this module is
re-required after nerd-icons already loaded).
Comment in the file records why deferral isn't workable here so a
future cleanup pass doesn't try the same change again.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/nerd-icons-config.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/modules/nerd-icons-config.el b/modules/nerd-icons-config.el index 52a4627dc..d314be801 100644 --- a/modules/nerd-icons-config.el +++ b/modules/nerd-icons-config.el @@ -69,16 +69,21 @@ every call. The `memq' check skips when the face is already present." ;; ------------------------------- Packages ------------------------------------ +;; `:demand t' is required: `dashboard-config.el' calls +;; `nerd-icons-faicon' / `nerd-icons-mdicon' / `nerd-icons-devicon' at +;; load time to build `dashboard-navigator-buttons', so nerd-icons must +;; be loaded eagerly before dashboard-config requires. The earlier +;; deferral attempt (commit d618bb46) broke startup with a +;; `void-function nerd-icons-faicon' error. (use-package nerd-icons - :defer t + :demand t :config (advice-add 'nerd-icons-icon-for-dir :filter-return #'cj/--nerd-icons-color-dir) (cj/nerd-icons-apply-tint)) -;; If nerd-icons is already loaded (e.g. when this module is re-evaluated -;; after a session in which a feature module already required it), the -;; `:config' block above won't fire again -- fall through to install the -;; advice and tint immediately. +;; Safety net: if this module is re-evaluated in a running Emacs where +;; nerd-icons is already loaded, `:config' above won't fire again -- +;; ensure the advice and tint still apply. (with-eval-after-load 'nerd-icons (unless (advice-member-p #'cj/--nerd-icons-color-dir 'nerd-icons-icon-for-dir) (advice-add 'nerd-icons-icon-for-dir |
