aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-21 18:24:47 -0500
committerCraig Jennings <c@cjennings.net>2026-07-21 18:24:47 -0500
commit59231c40190f200c2272d0275b2d9dc41d34fcef (patch)
treee975612aaaef445c78cd232067e8070478c126bb /tests
parent98dd0dfb24136f82e8f3b800b2fdb2bedd86324b (diff)
downloaddotemacs-59231c40190f200c2272d0275b2d9dc41d34fcef.tar.gz
dotemacs-59231c40190f200c2272d0275b2d9dc41d34fcef.zip
fix: stop M-SPC / M-S-SPC escaping the Full Agenda frame
M-SPC and M-S-SPC (the ai-term agent-swap chords) are bound in the global map, so pressing them inside the read-only frame jumped to ai-term instead of being contained. The frame's [t] catch-all can't deny them: a keymap's default binding doesn't shadow an explicit binding in a lower-priority map. Deny both explicitly in the frame keymap.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-org-agenda-frame.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test-org-agenda-frame.el b/tests/test-org-agenda-frame.el
index fc5b037b..fe4cee66 100644
--- a/tests/test-org-agenda-frame.el
+++ b/tests/test-org-agenda-frame.el
@@ -304,6 +304,16 @@ scroll spams the deny message."
;; global map); an unpunched key returns the catch-all deny handler.
(should (null (lookup-key cj/agenda-frame-mode-map key t)))))
+(ert-deftest test-org-agenda-frame-map-global-escape-chords-denied ()
+ "Boundary: global chords bound elsewhere (M-SPC / M-S-SPC swap ai-term
+agents) are denied by an explicit binding, not left to the [t] catch-all.
+A keymap's default binding does not shadow an explicit binding in a
+lower-priority map, so without an explicit deny here M-SPC follows its
+global binding and escapes the read-only frame into ai-term."
+ (dolist (key '("M-SPC" "M-S-SPC"))
+ (should (eq (lookup-key cj/agenda-frame-mode-map (kbd key))
+ 'cj/--agenda-frame-denied-readonly))))
+
(ert-deftest test-org-agenda-frame-map-unpunched-still-denied ()
"Normal: an ordinary unbound key still hits the catch-all after the punches."
(should (eq (lookup-key cj/agenda-frame-mode-map (kbd "t") t)