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-dirvish-config--side-key.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-dirvish-config--side-key.el')
| -rw-r--r-- | tests/test-dirvish-config--side-key.el | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/test-dirvish-config--side-key.el b/tests/test-dirvish-config--side-key.el new file mode 100644 index 00000000..1f08314c --- /dev/null +++ b/tests/test-dirvish-config--side-key.el @@ -0,0 +1,40 @@ +;;; test-dirvish-config--side-key.el --- dirvish-side lives on F9 -*- lexical-binding: t; -*- + +;;; Commentary: +;; The sidebar toggle moved from F11 to F9 on 2026-09-22 so F11 could go back +;; to `toggle-frame-fullscreen', the stock binding every other application +;; shares and which the :bind had been shadowing. F9 was the free bare +;; F-key: ai-term left it for M-SPC in June and the recording chord came off +;; it the same day this moved. F2 is the preview key and F5 is reserved for +;; the debug backend, so neither was a candidate. + +;;; Code: + +(require 'ert) +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'keybindings) +(require 'dirvish-config) + +;;; Normal + +(ert-deftest test-dirvish-config-side-on-f9 () + "Normal: F9 toggles the dirvish sidebar." + (should (eq (keymap-lookup global-map "<f9>") #'dirvish-side))) + +;;; Boundary + +(ert-deftest test-dirvish-config-side-not-on-f11 () + "Boundary/regression: F11 no longer reaches dirvish-side, so the stock +`toggle-frame-fullscreen' binding is no longer shadowed." + (should-not (eq (keymap-lookup global-map "<f11>") #'dirvish-side)) + (should (eq (keymap-lookup global-map "<f11>") #'toggle-frame-fullscreen))) + +;;; Error + +(ert-deftest test-dirvish-config-side-target-is-a-command () + "Error (positive control): the binding points at a real interactive +command, so a keypress does not fail with a `commandp' error at press time." + (should (commandp (keymap-lookup global-map "<f9>")))) + +(provide 'test-dirvish-config--side-key) +;;; test-dirvish-config--side-key.el ends here |
