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 | cce6e8265db0eea8af192b3737b50b81c39a9c0b (patch) | |
| tree | d6905bf6738c09c2f3fb14dc406a2ba138cc53ff /modules/nerd-icons-config.el | |
| parent | 500687f8d7d5b87ceb33fd959e545746ec9db1ba (diff) | |
| download | dotemacs-cce6e8265db0eea8af192b3737b50b81c39a9c0b.tar.gz dotemacs-cce6e8265db0eea8af192b3737b50b81c39a9c0b.zip | |
fix(nerd-icons): restore `:demand t' so dashboard-config can load
Commit d618bb46'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/nerd-icons-config.el')
| -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 52a4627d..d314be80 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 |
