From 60b51e1c996f1c8f152696946b9440f26ea9a956 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 25 May 2026 21:22:27 -0500 Subject: refactor(save): retire the immediate-push field setters for buffer-editors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The structured fields now reconcile at save (the previous commits), so the immediate-push setters are the duplicate path that made the package feel like it had two save models. I retired them. pearl-set-priority is deleted outright — priority is edited org-natively through the heading cookie. pearl-set-state, pearl-set-assignee, and pearl-set-labels become pearl-edit-state / -assignee / -labels: the same completing-read picker, but it writes the buffer representation (keyword/name/id, the assignee drawer, the labels drawer plus the live LINEAR-LABEL-IDS set) and marks the field dirty instead of pushing. The change goes out at the next pearl-save-issue / pearl-save-all. pearl-compose-current-description is renamed pearl-edit-description (its compose-and-push behavior is unchanged — v2 doesn't touch the compose buffers). The transient, the C-; L e keymap, the affordance preamble, and the README follow the new names, and the priority slots are dropped (no command — it's the org cookie). Deleting the setters left pearl--push-issue-field and pearl--priority-choices with no callers, so both are gone, along with the killed-buffer test that only exercised the removed helper. I filed a follow-up: the atomic savers' async commit callbacks need the same killed-buffer guard that helper carried. The setter command tests are rewritten to assert the buffer-write-and-no-push contract. The reconcile-and-push path they used to cover is exercised in test-pearl-save. --- tests/test-pearl-keymap.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tests/test-pearl-keymap.el') diff --git a/tests/test-pearl-keymap.el b/tests/test-pearl-keymap.el index 260b6fa..7cfc603 100644 --- a/tests/test-pearl-keymap.el +++ b/tests/test-pearl-keymap.el @@ -45,15 +45,16 @@ Walks MAP looking for a labeled binding (\"label\" . COMMAND)." (should (keymapp pearl-prefix-map))) (ert-deftest test-pearl-prefix-map-resolves-leaf-commands () - "Each chord resolves to its command (existing names, not yet renamed)." + "Each chord resolves to its command." (should (eq 'pearl-save-issue (lookup-key pearl-prefix-map (kbd "s s")))) (should (eq 'pearl-save-all (lookup-key pearl-prefix-map (kbd "s a")))) - (should (eq 'pearl-compose-current-description (lookup-key pearl-prefix-map (kbd "e d")))) + (should (eq 'pearl-edit-description (lookup-key pearl-prefix-map (kbd "e d")))) (should (eq 'pearl-edit-current-comment (lookup-key pearl-prefix-map (kbd "e c")))) - (should (eq 'pearl-set-priority (lookup-key pearl-prefix-map (kbd "e p")))) - (should (eq 'pearl-set-state (lookup-key pearl-prefix-map (kbd "e s")))) - (should (eq 'pearl-set-assignee (lookup-key pearl-prefix-map (kbd "e a")))) - (should (eq 'pearl-set-labels (lookup-key pearl-prefix-map (kbd "e l")))) + (should (eq 'pearl-edit-state (lookup-key pearl-prefix-map (kbd "e s")))) + (should (eq 'pearl-edit-assignee (lookup-key pearl-prefix-map (kbd "e a")))) + (should (eq 'pearl-edit-labels (lookup-key pearl-prefix-map (kbd "e l")))) + ;; priority has no edit command (org-native cookie); e p is unbound + (should-not (lookup-key pearl-prefix-map (kbd "e p"))) (should (eq 'pearl-new-issue (lookup-key pearl-prefix-map (kbd "n t")))) (should (eq 'pearl-add-comment (lookup-key pearl-prefix-map (kbd "n c")))) (should (eq 'pearl-delete-current-issue (lookup-key pearl-prefix-map (kbd "d t")))) @@ -77,10 +78,10 @@ Walks MAP looking for a labeled binding (\"label\" . COMMAND)." (ert-deftest test-pearl-prefix-map-which-key-labels () "Leaf bindings carry the edit/new verb labels; sub-prefixes carry +labels." - (should (string= "edit priority" - (test-pearl-keymap--label-of pearl-edit-map 'pearl-set-priority))) + (should (string= "edit state" + (test-pearl-keymap--label-of pearl-edit-map 'pearl-edit-state))) (should (string= "edit description" - (test-pearl-keymap--label-of pearl-edit-map 'pearl-compose-current-description))) + (test-pearl-keymap--label-of pearl-edit-map 'pearl-edit-description))) (should (string= "new ticket" (test-pearl-keymap--label-of pearl-new-map 'pearl-new-issue))) (should (string= "new comment" -- cgit v1.2.3