aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-25 09:25:32 -0500
committerCraig Jennings <c@cjennings.net>2026-05-25 09:25:32 -0500
commit56da3d940b26a51102bce39b3b82dfbbc2b391fd (patch)
tree54ce4e57ef954835ccc0fb7ebdb51a5c7c68f59b /tests
parenta522e5537ab9c94a45656b28e94a73b98f47d4b8 (diff)
downloaddotemacs-56da3d940b26a51102bce39b3b82dfbbc2b391fd.tar.gz
dotemacs-56da3d940b26a51102bce39b3b82dfbbc2b391fd.zip
feat(auto-dim): dim non-selected windows via auto-dim-other-buffers
I added auto-dim-config, a module that loads my local auto-dim-other-buffers fork and dims windows that don't have focus so the selected window stands out. A non-selected window drops to a pure-black background with faded gray text. The dimmed faces live in the dupre theme (themes/dupre-faces.el) so they track theme switches, and the module remaps default, the font-lock faces, and org-block onto them so syntax-highlighted code fades too rather than staying lit. Fringe is left out because dimming it forces a full-frame refresh that flickers on this non-pgtk build. dim-on-focus-out is nil, so tabbing to a browser or terminal on Hyprland doesn't dim the whole frame. vterm and agent windows don't dim either, because the terminal paints its own per-cell colors past the face remap. I'm keeping that, since the agent's output stays readable while I work in code on the other side. The module loads after the theme, carries a load-graph header, joins the header-contract allowlist, and the inventory moves to 103 of 103 classified.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-auto-dim-config.el33
-rw-r--r--tests/test-init-module-headers.el1
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/test-auto-dim-config.el b/tests/test-auto-dim-config.el
new file mode 100644
index 00000000..45e1db5f
--- /dev/null
+++ b/tests/test-auto-dim-config.el
@@ -0,0 +1,33 @@
+;;; test-auto-dim-config.el --- Tests for the auto-dim-other-buffers config -*- lexical-binding: t; -*-
+
+;;; Commentary:
+;; auto-dim-config configures the local auto-dim-other-buffers fork: dim only
+;; non-selected windows within Emacs (not the whole frame on focus-out), drop
+;; fringe from the dimmed faces to avoid flicker on this non-pgtk build, and
+;; enable the global mode. Guarded with `skip-unless' because the fork lives
+;; in ~/code and may be absent on a clean checkout.
+
+;;; Code:
+
+(require 'ert)
+(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
+
+(defconst test-auto-dim--fork
+ (expand-file-name "~/code/auto-dim-other-buffers.el")
+ "Local fork directory the module loads via `:load-path'.")
+
+(ert-deftest test-auto-dim-config-applies-settings ()
+ "Normal: loading the module enables the mode with the chosen settings."
+ (skip-unless (file-directory-p test-auto-dim--fork))
+ (require 'auto-dim-config)
+ (unwind-protect
+ (progn
+ (should (bound-and-true-p auto-dim-other-buffers-mode))
+ (should (null auto-dim-other-buffers-dim-on-focus-out))
+ (should (eq t auto-dim-other-buffers-dim-on-switch-to-minibuffer))
+ (should-not (assq 'fringe auto-dim-other-buffers-affected-faces)))
+ (when (fboundp 'auto-dim-other-buffers-mode)
+ (auto-dim-other-buffers-mode -1))))
+
+(provide 'test-auto-dim-config)
+;;; test-auto-dim-config.el ends here
diff --git a/tests/test-init-module-headers.el b/tests/test-init-module-headers.el
index af4f9ec9..ef5a7132 100644
--- a/tests/test-init-module-headers.el
+++ b/tests/test-init-module-headers.el
@@ -48,6 +48,7 @@
"text-config"
"undead-buffers"
;; Batch 4 — UI / core-UX modules (Layer 2)
+ "auto-dim-config"
"ui-config"
"ui-theme"
"ui-navigation"