diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-24 16:48:45 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-24 16:48:45 -0500 |
| commit | 01e1793831ee2a80a20e266ac3b0b950b71df240 (patch) | |
| tree | 0afacf5c58cc943d007189eac8204560a2af1e91 /tests/test-org-agenda-frame.el | |
| parent | 6a88b2618835937fa4a508f55e2454ac16d1f408 (diff) | |
| download | dotemacs-01e1793831ee2a80a20e266ac3b0b950b71df240.tar.gz dotemacs-01e1793831ee2a80a20e266ac3b0b950b71df240.zip | |
fix(agenda-frame): keep the allowlist when org-agenda loads first
- The read-only shadow walk keeps a key only when the frame map binds it commandp.
- It ran from with-eval-after-load partway up the file.
- The day/week/redo handlers are defined further down.
- With org-agenda already loaded, the walk fired before those defuns existed.
- So it read them as non-commands and denied d/w/g/r — the keys the allowlist grants.
- That is the normal startup order and every module reload.
- Moved the walk to the end of the file, after all the handlers are defined.
- A subprocess test loads org-agenda first and pins d/w/g/r surviving, t denied.
- Retitled the t-test to assert the deny outcome, not the pre-walk unbound state.
Diffstat (limited to 'tests/test-org-agenda-frame.el')
| -rw-r--r-- | tests/test-org-agenda-frame.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/test-org-agenda-frame.el b/tests/test-org-agenda-frame.el index fd8bd839..3c56d361 100644 --- a/tests/test-org-agenda-frame.el +++ b/tests/test-org-agenda-frame.el @@ -418,10 +418,15 @@ removed after a later success -- the failure banner would stick forever." (should (= 0 (seq-count (lambda (o) (overlay-get o 'before-string)) (overlays-in (point-min) (point-max))))))) -(ert-deftest test-org-agenda-frame-map-mutation-keys-not-explicitly-bound () - "Boundary: a mutation key (t = org-agenda-todo) is not explicitly bound, so the -[t] catch-all denies it as read-only." - (should (null (lookup-key cj/agenda-frame-mode-map (kbd "t"))))) +(ert-deftest test-org-agenda-frame-map-mutation-keys-denied () + "Boundary: a mutation key (t = org-agenda-todo) is denied, never allowlisted. +It is denied two ways depending on whether the shadow walk has run: the `[t]' +catch-all handles it (lookup returns nil) before the walk, and the walk binds +it explicitly to the deny handler once `org-agenda-mode-map' is present. Both +are a read-only denial; the test asserts the outcome, not which path produced +it, so it holds whether or not org-agenda is loaded in the test process." + (let ((b (lookup-key cj/agenda-frame-mode-map (kbd "t")))) + (should (or (null b) (eq b 'cj/--agenda-frame-denied-readonly))))) ;;; Default-deny policy — the minor mode + finalize re-enable |
