aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-10 06:26:28 -0500
committerCraig Jennings <c@cjennings.net>2026-07-10 06:26:28 -0500
commit216e10b4df8ce93aa42f005033ed07210d38a929 (patch)
tree7fa4819acefb963a722d12f2449f05592f2f66a2 /tests
parent6a193a6c4b36c6bae4a5e2f2a7a8e8b9a32aed71 (diff)
downloaddotemacs-216e10b4df8ce93aa42f005033ed07210d38a929.tar.gz
dotemacs-216e10b4df8ce93aa42f005033ed07210d38a929.zip
fix(auto-dim): dim org-superstar's heading stars and list bullets
Bullets were the last thing left lit in an unfocused org window. org-superstar puts its own face ahead of the org face beneath, so a heading star renders as (org-superstar-header-bullet org-level-1) and outranks the org-level-1 we already dim. Three of its four faces flat-dim. The fourth, org-superstar-leading, takes the -hide face instead: its foreground is the background colour, which is exactly what keeps hidden leading stars invisible. Flat-dimming it would reveal stars I chose to hide. A test says so, so nobody completes the set later. That closes the dimming work. The parenthesised text from the first report turned out to be org-code and org-verbatim, already covered.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-auto-dim-config.el33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/test-auto-dim-config.el b/tests/test-auto-dim-config.el
index a85a77b4..869eb409 100644
--- a/tests/test-auto-dim-config.el
+++ b/tests/test-auto-dim-config.el
@@ -62,6 +62,15 @@ They fontify links in help, info, and customize buffers. Both carry
`:underline t', which survives the relative remap, so a dimmed link still
reads as a link.")
+(defconst test-auto-dim--flat-dimmed-superstar-faces
+ '(org-superstar-header-bullet org-superstar-item org-superstar-first)
+ "org-superstar faces that must flat-dim.
+org-superstar puts its own face ahead of the org face beneath, so a heading
+star renders as (org-superstar-header-bullet org-level-1) and wins over the
+dimmed org-level-1. Without these, bullets stay lit in an unfocused window
+even though every face under them dims.
+`org-superstar-leading' is excluded on purpose -- see the test below.")
+
(defconst test-auto-dim--keyword-dim-variants
'((org-faces-todo . org-faces-todo-dim)
(org-faces-doing . org-faces-doing-dim)
@@ -102,6 +111,30 @@ like links and this test says so."
(should (eq 'unspecified
(face-attribute 'auto-dim-other-buffers :underline nil nil))))
+(ert-deftest test-auto-dim-config-superstar-bullets-flat-dim ()
+ "Normal: org-superstar's heading stars and list bullets flat-dim.
+They were the last thing left lit in an unfocused org window."
+ (skip-unless (file-directory-p test-auto-dim--fork))
+ (require 'auto-dim-config)
+ (dolist (face test-auto-dim--flat-dimmed-superstar-faces)
+ (let ((entry (assq face auto-dim-other-buffers-affected-faces)))
+ (should entry)
+ (should (eq 'auto-dim-other-buffers (car (cdr entry))))
+ (should (null (cdr (cdr entry)))))))
+
+(ert-deftest test-auto-dim-config-superstar-leading-uses-hide-face ()
+ "Error: `org-superstar-leading' takes the -hide face, never the flat dim.
+Its foreground is the background colour, which is what keeps hidden leading
+stars invisible. Flat-dimming it would give them the dim face's visible grey
+and reveal stars the user chose to hide. Same contract as `org-hide'."
+ (skip-unless (file-directory-p test-auto-dim--fork))
+ (require 'auto-dim-config)
+ (should-not (memq 'org-superstar-leading
+ test-auto-dim--flat-dimmed-superstar-faces))
+ (let ((entry (assq 'org-superstar-leading auto-dim-other-buffers-affected-faces)))
+ (should entry)
+ (should (eq 'auto-dim-other-buffers-hide (car (cdr entry))))))
+
(ert-deftest test-auto-dim-config-keyword-faces-keep-dim-variants ()
"Boundary: org TODO-keyword faces keep dedicated -dim variants, not flat dim.
Keyword status is scanned across unfocused windows, so it earns a variant;