diff options
| author | Craig Jennings <c@cjennings.net> | 2026-09-22 14:29:33 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-09-22 14:29:33 -0400 |
| commit | 7c9f92eb0a6751d04a43ffe3cc5f725fce5ab371 (patch) | |
| tree | 66b997100cfd7067328283e5c7568b1f650cf2a8 /tests/test-org-capture-config-fkey-guard.el | |
| parent | befb206ae7b2daeb61acd20f11aa9d2d5017733f (diff) | |
| download | dotemacs-7c9f92eb0a6751d04a43ffe3cc5f725fce5ab371.tar.gz dotemacs-7c9f92eb0a6751d04a43ffe3cc5f725fce5ab371.zip | |
Stock Emacs binds F11 to toggle-frame-fullscreen, the key every other application uses for it. This config never rebound it, but dirvish-config's :bind put dirvish-side on F11 and shadowed the stock binding. I moved the sidebar toggle to F9, the free bare F-key: ai-term left it for M-SPC in June and the recording chord came off it today. F2 is the preview key and F5 is reserved for the debug backend, so neither was a candidate.
The org-capture F-key guard follows the command rather than the key. F9 joins its list and F11 leaves it, since a fullscreen toggle pops nothing over a capture. The tests pin the new key, the un-shadowed F11, and the guard change.
Diffstat (limited to 'tests/test-org-capture-config-fkey-guard.el')
| -rw-r--r-- | tests/test-org-capture-config-fkey-guard.el | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/test-org-capture-config-fkey-guard.el b/tests/test-org-capture-config-fkey-guard.el index b288ce4f..c0687bb2 100644 --- a/tests/test-org-capture-config-fkey-guard.el +++ b/tests/test-org-capture-config-fkey-guard.el @@ -2,8 +2,10 @@ ;;; Commentary: ;; While a capture is in progress, the global popup keys (F1 dashboard -;; sweep, F10 music, F11 dirvish-side, F12 terminal, M-SPC agent swap) -;; must not fire and pop UI over the capture. org-capture-mode is a +;; sweep, F9 dirvish-side, F10 music, F12 terminal, M-SPC agent swap) +;; must not fire and pop UI over the capture. F11 is deliberately not on +;; the list: it toggles frame fullscreen, which pops nothing over the +;; capture, so blocking it would only get in the way. org-capture-mode is a ;; minor mode active exactly for the capture's duration and its keymap ;; shadows the global map, so the guard binds those keys there to a ;; blocker that signals a `user-error' naming the way out. @@ -21,10 +23,17 @@ (ert-deftest test-org-capture-fkey-guard-keys-bound () "Normal: every leaking popup key is bound to the blocker in capture mode." - (dolist (key '("<f1>" "<f10>" "<f11>" "<f12>" "M-SPC")) + (dolist (key '("<f1>" "<f9>" "<f10>" "<f12>" "M-SPC")) (should (eq (keymap-lookup org-capture-mode-map key) #'cj/--org-capture-blocked-key)))) +(ert-deftest test-org-capture-fkey-guard-leaves-fullscreen-alone () + "Boundary: F11 (frame fullscreen) is not blocked. It pops no UI, and +before dirvish-side moved to F9 it was on this list only because F11 was the +sidebar key; the entry must follow the command, not the key." + (should-not (eq (keymap-lookup org-capture-mode-map "<f11>") + #'cj/--org-capture-blocked-key))) + (ert-deftest test-org-capture-fkey-guard-blocker-signals-user-error () "Error: the blocker signals a user-error rather than doing nothing." (should-error (cj/--org-capture-blocked-key) :type 'user-error)) |
