diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-12 10:20:45 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-12 10:20:45 -0500 |
| commit | 27453b4faa9dcd6a672dabd06b2a1fb300fedeef (patch) | |
| tree | 0b3c9dd770ca8fe774e69379f4ff55714b73f36b | |
| parent | 4d9c9fa672ec57551fa8c9d2d25ea60b59dbef52 (diff) | |
| download | dotemacs-27453b4faa9dcd6a672dabd06b2a1fb300fedeef.tar.gz dotemacs-27453b4faa9dcd6a672dabd06b2a1fb300fedeef.zip | |
fix(dashboard): add EMMS exclusion to recentf-exclude without clobbering it
dashboard-config used setq on recentf-exclude, discarding the five exclusions system-defaults adds earlier in init order (bookmarks, elpa, recentf, ElfeedDB, airootfs). Extract the EMMS exclusion into cj/--dashboard-exclude-emms-from-recentf (the :config side-effect was not reachable for a test) and use add-to-list so prior entries survive. Two ERT tests cover preservation and the added pattern.
| -rw-r--r-- | modules/dashboard-config.el | 8 | ||||
| -rw-r--r-- | tests/test-dashboard-config-recentf-exclude.el | 33 | ||||
| -rw-r--r-- | todo.org | 5 |
3 files changed, 43 insertions, 3 deletions
diff --git a/modules/dashboard-config.el b/modules/dashboard-config.el index b4e4545d..c70b78c2 100644 --- a/modules/dashboard-config.el +++ b/modules/dashboard-config.el @@ -145,6 +145,12 @@ window." ;; --------------------------------- Dashboard --------------------------------- ;; a useful startup screen for Emacs +(defun cj/--dashboard-exclude-emms-from-recentf () + "Exclude the EMMS history file from recentf. +Adds to `recentf-exclude' so entries set elsewhere (e.g. in +system-defaults) are preserved rather than overwritten." + (add-to-list 'recentf-exclude "/emms/history")) + (use-package dashboard :demand t :hook (emacs-startup . cj/dashboard-only) @@ -196,7 +202,7 @@ window." (setq dashboard-bookmarks-show-path nil) ;; don't show paths in bookmarks (setq dashboard-recentf-show-base t) ;; show filename, not full path (setq dashboard-recentf-item-format "%s") - (setq recentf-exclude '("/emms/history")) ;; exclude EMMS history from recent files + (cj/--dashboard-exclude-emms-from-recentf) ;; exclude EMMS history from recent files (setq dashboard-set-footer nil) ;; don't show footer and quotes ;; == navigation diff --git a/tests/test-dashboard-config-recentf-exclude.el b/tests/test-dashboard-config-recentf-exclude.el new file mode 100644 index 00000000..f35b3eda --- /dev/null +++ b/tests/test-dashboard-config-recentf-exclude.el @@ -0,0 +1,33 @@ +;;; test-dashboard-config-recentf-exclude.el --- recentf-exclude is not clobbered -*- lexical-binding: t; -*- + +;;; Commentary: +;; `cj/--dashboard-exclude-emms-from-recentf' adds the EMMS history pattern +;; to `recentf-exclude'. It must ADD to the list, not replace it, or it +;; wipes the exclusions system-defaults.el set earlier in init order +;; (emacs_bookmarks, elpa, recentf, ElfeedDB, airootfs). + +;;; Code: + +(require 'ert) +(require 'recentf) ; makes `recentf-exclude' special so the let below is dynamic + +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'testutil-general) +(require 'dashboard-config) + +(ert-deftest test-dashboard-config-exclude-emms-preserves-existing-entries () + "Error: excluding the EMMS history preserves prior recentf-exclude entries." + (let ((recentf-exclude (list "emacs_bookmarks" "airootfs"))) + (cj/--dashboard-exclude-emms-from-recentf) + (should (member "/emms/history" recentf-exclude)) + (should (member "emacs_bookmarks" recentf-exclude)) + (should (member "airootfs" recentf-exclude)))) + +(ert-deftest test-dashboard-config-exclude-emms-adds-the-pattern () + "Normal: the EMMS history pattern is present after the call." + (let ((recentf-exclude nil)) + (cj/--dashboard-exclude-emms-from-recentf) + (should (member "/emms/history" recentf-exclude)))) + +(provide 'test-dashboard-config-recentf-exclude) +;;; test-dashboard-config-recentf-exclude.el ends here @@ -780,8 +780,9 @@ Also =jumper.el:178= — the promised single-location toggle never toggles back ** TODO [#B] C-s C-s vertico-repeat path never works :bug:quick:solo: =modules/selection-framework.el:263= — =cj/consult-line-or-repeat= calls =vertico-repeat= on the second consecutive C-s, but nothing adds =vertico-repeat-save= to =minibuffer-setup-hook= (grep: zero hits config-wide), so it always signals "No Vertico session". Add the hook next to the vertico use-package block. From the 2026-06 config audit. -** TODO [#B] dashboard-config setq wipes recentf-exclude list :bug:quick:solo: -=modules/dashboard-config.el:199= =(setq recentf-exclude '("/emms/history"))= discards the five exclusions system-defaults.el:239-243 added earlier in init order (bookmarks, elpa, recentf, ElfeedDB, airootfs). Change to =add-to-list=. From the 2026-06 config audit. +** DONE [#B] dashboard-config setq wipes recentf-exclude list :bug:quick:solo: +CLOSED: [2026-06-12 Fri] +Fixed in =modules/dashboard-config.el=: extracted the EMMS exclusion into =cj/--dashboard-exclude-emms-from-recentf= (the =:config= side-effect was not reachable for a test) and switched =setq= to =add-to-list=, so the five exclusions system-defaults adds earlier in init order survive. Two ERT tests in =tests/test-dashboard-config-recentf-exclude.el= (preserves prior entries / adds the pattern); the preservation test was red before, green after. Live-reloaded into the daemon and restored the five wiped entries in the running session. ** TODO [#B] auth-config: unguarded gpg-connect-agent call + compile-time require :bug:quick:solo: From the 2026-06 config audit. =modules/auth-config.el:88= — bare =(call-process "gpg-connect-agent" ...)= in a =:demand t= :config signals file-missing and aborts init on machines without the binary; guard with =cj/executable-find-or-warn=. =auth-config.el:36= — =user-constants= is required only =eval-when-compile= but =authinfo-file= is read at load time; works from .el source, fails from standalone .elc. Use a runtime require (system-defaults.el:32-35 documents this exact trap). |
