aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/font-config.el35
-rw-r--r--modules/keyboard-compat.el6
-rw-r--r--tests/test-font-config--frame-lifecycle.el10
-rw-r--r--tests/test-font-config.el12
4 files changed, 26 insertions, 37 deletions
diff --git a/modules/font-config.el b/modules/font-config.el
index 2be051ddc..095b4c8c1 100644
--- a/modules/font-config.el
+++ b/modules/font-config.el
@@ -165,32 +165,27 @@ If FRAME is nil, uses the selected frame."
t
nil))
-;; ------------------------------- All The Icons -------------------------------
-;; icons made available through fonts
+;; ------------------------------- Nerd Icons fonts ----------------------------
+;; nerd-icons (configured in nerd-icons-config.el) renders glyphs from the
+;; "Symbols Nerd Font Mono" font. Auto-install it on the first GUI frame when
+;; it is missing -- the same convenience the dropped all-the-icons setup gave.
-(declare-function all-the-icons-install-fonts "all-the-icons")
+(declare-function nerd-icons-install-fonts "nerd-icons")
-(defun cj/maybe-install-all-the-icons-fonts (&optional _frame)
- "Install all-the-icons fonts if needed and we have a GUI."
+(defun cj/maybe-install-nerd-icons-fonts (&optional _frame)
+ "Install the nerd-icons font if it is missing and we have a GUI."
(when (and (env-gui-p)
- (not (cj/font-installed-p "all-the-icons")))
- (all-the-icons-install-fonts t)
+ (not (cj/font-installed-p "Symbols Nerd Font Mono")))
+ (nerd-icons-install-fonts t)
;; Remove this hook after successful installation
- (remove-hook 'server-after-make-frame-hook #'cj/maybe-install-all-the-icons-fonts)))
+ (remove-hook 'server-after-make-frame-hook #'cj/maybe-install-nerd-icons-fonts)))
-(use-package all-the-icons
- :demand t
- :config
- ;; Handle both daemon and non-daemon modes
+;; nerd-icons loads after this module (see init.el order), so defer the wiring
+;; until it is present. Daemon: install on the first GUI frame; otherwise now.
+(with-eval-after-load 'nerd-icons
(if (daemonp)
- (add-hook 'server-after-make-frame-hook #'cj/maybe-install-all-the-icons-fonts)
- (cj/maybe-install-all-the-icons-fonts)))
-
-(use-package all-the-icons-nerd-fonts
- :after all-the-icons
- :demand t
- :config
- (all-the-icons-nerd-fonts-prefer))
+ (add-hook 'server-after-make-frame-hook #'cj/maybe-install-nerd-icons-fonts)
+ (cj/maybe-install-nerd-icons-fonts)))
;; ----------------------------- Emoji Fonts Per OS ----------------------------
diff --git a/modules/keyboard-compat.el b/modules/keyboard-compat.el
index 172f96c7b..9395b9c86 100644
--- a/modules/keyboard-compat.el
+++ b/modules/keyboard-compat.el
@@ -68,12 +68,6 @@ This runs after init to override any package settings."
nerd-icons-icon-for-buffer))
(advice-add fn :around #'cj/--icon-blank-in-terminal)))
-(with-eval-after-load 'all-the-icons
- (dolist (fn '(all-the-icons-icon-for-file
- all-the-icons-icon-for-dir
- all-the-icons-icon-for-mode))
- (advice-add fn :around #'cj/--icon-blank-in-terminal)))
-
;; =============================================================================
;; GUI-specific fixes
;; =============================================================================
diff --git a/tests/test-font-config--frame-lifecycle.el b/tests/test-font-config--frame-lifecycle.el
index 826edbd69..8f338b996 100644
--- a/tests/test-font-config--frame-lifecycle.el
+++ b/tests/test-font-config--frame-lifecycle.el
@@ -2,7 +2,7 @@
;;; Commentary:
;; cj/apply-font-settings-to-frame, cj/cleanup-frame-list, and
-;; cj/maybe-install-all-the-icons-fonts were defined inside use-package
+;; cj/maybe-install-nerd-icons-fonts were defined inside use-package
;; :config / with-eval-after-load (unreachable under `make test'). Lifting
;; them to top level makes their branching unit-testable; env-gui-p and the
;; package side-effect calls are mocked at the boundary.
@@ -57,9 +57,9 @@
(let ((installed nil))
(cl-letf (((symbol-function 'env-gui-p) (lambda () t))
((symbol-function 'cj/font-installed-p) (lambda (_n) nil))
- ((symbol-function 'all-the-icons-install-fonts) (lambda (&rest _) (setq installed t)))
+ ((symbol-function 'nerd-icons-install-fonts) (lambda (&rest _) (setq installed t)))
((symbol-function 'remove-hook) #'ignore))
- (cj/maybe-install-all-the-icons-fonts))
+ (cj/maybe-install-nerd-icons-fonts))
(should installed)))
(ert-deftest test-font-maybe-install-icons-already-present-skips ()
@@ -67,8 +67,8 @@
(let ((installed nil))
(cl-letf (((symbol-function 'env-gui-p) (lambda () t))
((symbol-function 'cj/font-installed-p) (lambda (_n) t))
- ((symbol-function 'all-the-icons-install-fonts) (lambda (&rest _) (setq installed t))))
- (cj/maybe-install-all-the-icons-fonts))
+ ((symbol-function 'nerd-icons-install-fonts) (lambda (&rest _) (setq installed t))))
+ (cj/maybe-install-nerd-icons-fonts))
(should-not installed)))
(provide 'test-font-config--frame-lifecycle)
diff --git a/tests/test-font-config.el b/tests/test-font-config.el
index 8fada25e2..393a77584 100644
--- a/tests/test-font-config.el
+++ b/tests/test-font-config.el
@@ -5,9 +5,10 @@
;; font-config.el is mostly top-level font/package setup. These smoke tests
;; cover the logic that should stay correct regardless of which fonts are
;; installed: the install check, and the daemon-frame font applier (env-gui-p
-;; guard plus idempotency). The module :demand's fontaine and all-the-icons,
-;; so the tests skip when those packages are absent rather than failing on a
-;; bare checkout. GUI and font lookups are stubbed so the run stays headless.
+;; guard plus idempotency). The module :demand's fontaine and references
+;; nerd-icons, so the tests skip when those packages are absent rather than
+;; failing on a bare checkout. GUI and font lookups are stubbed so the run
+;; stays headless.
;;; Code:
@@ -21,9 +22,8 @@
(defconst test-font-config--available
(and (locate-library "fontaine")
- (locate-library "all-the-icons")
- (locate-library "all-the-icons-nerd-fonts"))
- "Non-nil when the packages font-config :demand's are loadable.")
+ (locate-library "nerd-icons"))
+ "Non-nil when the packages font-config needs are loadable.")
;;; cj/font-installed-p