diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-21 18:21:06 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-21 18:21:06 -0500 |
| commit | 98dd0dfb24136f82e8f3b800b2fdb2bedd86324b (patch) | |
| tree | 2ba90a01a5b5c3adddf87e2397a6a10ecb9604a3 | |
| parent | 08afe85598ade265341b4ea72ec2ece25ddc42fd (diff) | |
| download | dotemacs-98dd0dfb24136f82e8f3b800b2fdb2bedd86324b.tar.gz dotemacs-98dd0dfb24136f82e8f3b800b2fdb2bedd86324b.zip | |
fix: bind g to refresh inside the Full Agenda frame
The frame's default-deny policy classed g as a view-change and denied it, so the muscle-memory refresh key printed the fixed-view message instead of rebuilding. Bind g to the same frame-scoped safe redo as r. C-M-<f8> stays the force-rescan.
| -rw-r--r-- | modules/org-agenda-frame.el | 6 | ||||
| -rw-r--r-- | tests/test-org-agenda-frame.el | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/modules/org-agenda-frame.el b/modules/org-agenda-frame.el index d7fc3d4d..0d4f599e 100644 --- a/modules/org-agenda-frame.el +++ b/modules/org-agenda-frame.el @@ -253,6 +253,10 @@ The default binding for every key not on the allowlist." (define-key map (kbd "Q") #'cj/--agenda-frame-close) (define-key map (kbd "x") #'cj/--agenda-frame-close) (define-key map (kbd "r") #'cj/--agenda-frame-safe-redo) + ;; g is the muscle-memory agenda refresh; keep it working here (the + ;; frame-scoped safe redo, same as r) rather than denying it as a + ;; view-change. C-M-<f8> stays the force-rescan. + (define-key map (kbd "g") #'cj/--agenda-frame-safe-redo) (define-key map (kbd "S-<f8>") #'cj/agenda-frame-toggle) (define-key map (kbd "C-M-<f8>") #'cj/org-agenda-refresh-files) ;; C-x C-c means "close this frame" here. The global @@ -273,7 +277,7 @@ The default binding for every key not on the allowlist." (kbd "C-h"))) (define-key map key nil)) ;; View-changers get the distinct fixed-view message, not the read-only one. - (dolist (key '("w" "d" "y" "f" "b" "j" "g")) + (dolist (key '("w" "d" "y" "f" "b" "j")) (define-key map (kbd key) #'cj/--agenda-frame-denied-fixed-view)) map) "Keymap for `cj/agenda-frame-mode'. diff --git a/tests/test-org-agenda-frame.el b/tests/test-org-agenda-frame.el index 21842600..fc5b037b 100644 --- a/tests/test-org-agenda-frame.el +++ b/tests/test-org-agenda-frame.el @@ -255,16 +255,19 @@ graphical frame and RET would be denied instead of opening the item." 'cj/--agenda-frame-engage-open))) (ert-deftest test-org-agenda-frame-map-lifecycle-keys () - "Normal: q/Q/x close the frame; r takes the safe-redo path." + "Normal: q/Q/x close the frame; r and g take the safe-redo path. +g is the muscle-memory agenda refresh; it must refresh, not hit the +fixed-view deny handler." (should (eq (lookup-key cj/agenda-frame-mode-map (kbd "q")) 'cj/--agenda-frame-close)) (should (eq (lookup-key cj/agenda-frame-mode-map (kbd "Q")) 'cj/--agenda-frame-close)) (should (eq (lookup-key cj/agenda-frame-mode-map (kbd "x")) 'cj/--agenda-frame-close)) - (should (eq (lookup-key cj/agenda-frame-mode-map (kbd "r")) 'cj/--agenda-frame-safe-redo))) + (should (eq (lookup-key cj/agenda-frame-mode-map (kbd "r")) 'cj/--agenda-frame-safe-redo)) + (should (eq (lookup-key cj/agenda-frame-mode-map (kbd "g")) 'cj/--agenda-frame-safe-redo))) (ert-deftest test-org-agenda-frame-map-view-changers-fixed-view-deny () "Boundary: view-changing keys are explicitly denied with the fixed-view message, not caught by the read-only catch-all." - (dolist (key '("w" "d" "y" "f" "b" "j" "g")) + (dolist (key '("w" "d" "y" "f" "b" "j")) (should (eq (lookup-key cj/agenda-frame-mode-map (kbd key)) 'cj/--agenda-frame-denied-fixed-view)))) |
