aboutsummaryrefslogtreecommitdiff
path: root/tests/test-ui-config--buffer-cursor-state.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-16 02:56:25 -0500
committerCraig Jennings <c@cjennings.net>2026-05-16 02:56:25 -0500
commitd618bb4620d5d651027e772b8ccc490e1bab6d80 (patch)
treebd0b6d0e2fcde37a0ca27f038a19bac8b39f3578 /tests/test-ui-config--buffer-cursor-state.el
parenta9a4d8c7148c115a242a7b35d16dd536f9c0c700 (diff)
downloaddotemacs-d618bb4620d5d651027e772b8ccc490e1bab6d80.tar.gz
dotemacs-d618bb4620d5d651027e772b8ccc490e1bab6d80.zip
refactor(ui): four UI/navigation hygiene fixes from module-by-module re-review
- popper-config.el: move `(popper-mode +1)` and `(popper-echo-mode +1)` from the use-package `:init` block into `:config`. `:disabled t' on use-package skips `:config' but still runs `:init', so the previous shape enabled popper-mode on every load, including batch / test runs, despite the disabled marker. - modeline-config.el: make `cj/modeline-vc-fetch' fall back when the internal `vc-git--symbolic-ref' is missing. `require' uses `nil 'noerror', the call sits inside an `fboundp' guard, and `ignore-errors' wraps the call itself so an Emacs version that renames or removes the accessor leaves `branch' at `vc-working-revision''s output instead of crashing the modeline. - ui-config.el: guard the cursor-color `post-command-hook' behind `(display-graphic-p)' both at install time and inside the function body. Batch / TTY runs short-circuit cleanly with no per-command overhead. A `server-after-make-frame-hook' catches the daemon case where the first GUI frame is created after ui-config loads and installs the hook lazily. Updates test-ui-config--buffer-cursor-state and test-ui-cursor-color-integration to stub `display-graphic-p' so the work body still runs under batch. - nerd-icons-config.el: drop `:demand t' (`:defer t' now), keeping the `:config' advice install as the natural lazy-on-load path. Add a `with-eval-after-load 'nerd-icons' block as a safety net for the already-loaded case on re-eval; the block uses `advice-member-p' so the advice never stacks.
Diffstat (limited to 'tests/test-ui-config--buffer-cursor-state.el')
-rw-r--r--tests/test-ui-config--buffer-cursor-state.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test-ui-config--buffer-cursor-state.el b/tests/test-ui-config--buffer-cursor-state.el
index add0d030..ead05741 100644
--- a/tests/test-ui-config--buffer-cursor-state.el
+++ b/tests/test-ui-config--buffer-cursor-state.el
@@ -72,7 +72,9 @@ buffer the user navigates, so `read-only' (orange) is kept."
(ert-deftest test-ui-config-set-cursor-color-live-vterm-not-orange ()
"Normal: in a live vterm the cursor-color hook picks a writeable color,
-not the read-only orange -- even though the vterm buffer is read-only."
+not the read-only orange -- even though the vterm buffer is read-only.
+`display-graphic-p' is stubbed t so the function reaches its work body
+in batch mode (the live function no-ops on TTY frames by design)."
(let ((buf (cj/test--make-fake-vterm-buffer "*test-vterm-cursor-color*"))
(applied 'unset))
(unwind-protect
@@ -81,7 +83,8 @@ not the read-only orange -- even though the vterm buffer is read-only."
(setq-local vterm-copy-mode nil)
(let ((cj/-cursor-last-color nil)
(cj/-cursor-last-buffer nil))
- (cl-letf (((symbol-function 'set-cursor-color)
+ (cl-letf (((symbol-function 'display-graphic-p) (lambda () t))
+ ((symbol-function 'set-cursor-color)
(lambda (c) (setq applied c))))
(cj/set-cursor-color-according-to-mode)))
(should (stringp applied))