aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.claude/rules/patterns.md29
-rw-r--r--modules/term-config.el7
-rw-r--r--tests/test-term-tmux-history.el11
-rw-r--r--todo.org4
4 files changed, 47 insertions, 4 deletions
diff --git a/.claude/rules/patterns.md b/.claude/rules/patterns.md
new file mode 100644
index 00000000..e079a288
--- /dev/null
+++ b/.claude/rules/patterns.md
@@ -0,0 +1,29 @@
+# Pattern Catalog Pointer
+
+Applies to: `**/*`
+
+A curated catalog of reusable interaction-design patterns lives at `~/code/rulesets/patterns/`. Each pattern is one file capturing a small principle with wide surface area — discovered in one project, written down so the next project doesn't re-derive it.
+
+## When to consult it
+
+Before designing any user-facing interaction choice, read the relevant pattern instead of reinventing the shape:
+
+- A prompt or a chain of prompts (a completing-read, a wizard, a multi-step form)
+- A picker over N candidates where the kind of candidate matters, not just the name
+- A default for a yes/no or multiple-choice prompt
+- A confirmation whose friction should match its consequence
+- Any "should this be one prompt or several?" decision
+
+These patterns came out of Emacs/Elisp prompt design, but the principles are interface-general — they apply to a CLI flow, a web form, or a TUI just as well.
+
+## How to load it
+
+Don't carry the whole catalog in context. Read `~/code/rulesets/patterns/README.org` for the index and the one-line principle of each pattern, then read the single pattern file you need (the patterns are `.org` files). Humans grep `patterns/` directly.
+
+## The root principle
+
+The patterns converge on one idea: the choices the user has should all be on screen, accurately labeled, ordered by what they'll most often want, with friction sized to the cost of being wrong. Each pattern file is one worked shape of that principle.
+
+## Adding to it
+
+A new pattern is captured as a raw note in a project's `docs/design/` when it lands, then promoted into `patterns/` in a batched review (see `patterns/README.md` for the cadence and the frontmatter contract). Don't formalize every rough note inline — capture on landing, promote on review.
diff --git a/modules/term-config.el b/modules/term-config.el
index 5753edde..7cd386dc 100644
--- a/modules/term-config.el
+++ b/modules/term-config.el
@@ -229,9 +229,12 @@ run its own project-named tmux session instead of a bare, auto-named one.
;; rebuild is what actually lets the key through to `ghostel-mode-map' / the
;; global map. C-; and F12 are the prefix + toggle; the modified arrows are
;; windmove (S-arrows, focus) and buffer-move (C-M-arrows, swap), which the
- ;; ai-term workflow expects to work from inside an agent buffer.
+ ;; ai-term workflow expects to work from inside an agent buffer. F10 and
+ ;; C-F10 are global bindings (music-playlist toggle, server shutdown) that
+ ;; reach Emacs by falling through to the global map once the semi-char map
+ ;; stops forwarding them.
(with-eval-after-load 'ghostel
- (dolist (key '("C-;" "<f12>"
+ (dolist (key '("C-;" "<f12>" "<f10>" "C-<f10>"
"S-<up>" "S-<down>" "S-<left>" "S-<right>"
"C-M-<up>" "C-M-<down>" "C-M-<left>" "C-M-<right>"))
(add-to-list 'ghostel-keymap-exceptions key))
diff --git a/tests/test-term-tmux-history.el b/tests/test-term-tmux-history.el
index 1bb7e73b..b7ab5351 100644
--- a/tests/test-term-tmux-history.el
+++ b/tests/test-term-tmux-history.el
@@ -327,6 +327,17 @@ instead of being forwarded to the terminal program."
(should-not (eq (keymap-lookup ghostel-semi-char-mode-map "C-M-<left>")
'ghostel--send-event)))
+(ert-deftest test-term-f10-music-and-shutdown-in-keymap-exceptions ()
+ "Regression: F10 (music playlist toggle) and C-F10 (server shutdown) are in
+`ghostel-keymap-exceptions' so they reach Emacs from inside a ghostel buffer
+instead of being forwarded to the terminal program. Both are global bindings,
+so dropping them from the semi-char map lets the lookup fall through to the
+global map."
+ (dolist (key '("<f10>" "C-<f10>"))
+ (should (member key ghostel-keymap-exceptions)))
+ (should-not (eq (keymap-lookup ghostel-semi-char-mode-map "<f10>")
+ 'ghostel--send-event)))
+
(ert-deftest test-term-c-spc-forwarded-not-set-mark ()
"Regression: C-SPC is forwarded to the terminal, not bound to the global
`set-mark-command'. ghostel only forwards the `C-@' event, so without this an
diff --git a/todo.org b/todo.org
index 9f75b00d..ac0a59bd 100644
--- a/todo.org
+++ b/todo.org
@@ -258,8 +258,8 @@ D2 — set the 16 ghostel-color-* + ghostel-default faces in dupre-faces/palette
*** TODO [#C] Follow-up: evaluate ghostel-eshell + ghostel-compile :terminal:ghostel:eval:
D3 — ghostel-eshell as eshell visual backend; ghostel-compile against F4 dev-fkeys.
-*** TODO [#C] Revisit auto-dim for ghostel terminals :terminal:ghostel:auto-dim:
-D1 shipped "terminal buffers don't participate in unfocused-window dimming" because ghostel resolves its color palette to hex and pushes it into the native module per-terminal (=ghostel--apply-palette= / =ghostel--set-palette=), so there's no per-window color hook like vterm's =vterm--get-color= advice. The spike confirmed buffer-local =face-remap= does NOT dim a ghostel buffer. Investigate the alternatives: (a) keep no-dim (current); (b) buffer-wide dim on focus-loss by re-pushing a palette blended toward bg via =ghostel-sync-theme= + redraw (per-buffer, forces a repaint, only coherent when the buffer is in one window — measure the flicker cost); (c) check whether ghostel gains/exposes a per-window dim hook upstream. Acceptance: a measured decision, not just left at the v1 default. Context: [[file:docs/design/vterm-to-ghostel-migration-spec.org][migration spec]] D1.
+*** 2026-06-05 Fri @ 14:24:02 -0500 Auto-dim revisit cancelled — current no-dim behavior is fine
+Craig confirmed the shipped auto-dim setup works fine as-is: terminal buffers don't participate in unfocused-window dimming (D1), and the rest of auto-dim behaves. That is the measured decision the original task asked for — option (a), keep no-dim — so no rework (the focus-loss palette-blend in option (b) or an upstream per-window hook in option (c)) is needed. Closing without further investigation. Context: [[file:docs/design/vterm-to-ghostel-migration-spec.org][migration spec]] D1.
*** TODO [#C] Investigate ghostel selection/highlight color :terminal:ghostel:
Look at how selected text is highlighted in a ghostel buffer — the region face in =ghostel-copy-mode= and any live selection — surfaced during the copy-mode debugging. Check whether the highlight is legible against the dupre background and consistent with the rest of the config; if it needs theming, fold it in with D2 (theming the ghostel faces in dupre).