From 9b17dc89fc25417e207943dafe8bf09ac211ae32 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 25 May 2026 05:00:48 -0500 Subject: feat: add pearl-delete-current-comment Pearl could render, create, and edit comments but not delete one, so removing your own comment meant leaving Emacs for the web app. I added the delete command and filled the reserved C-; L d c keymap slot. pearl-delete-current-comment runs from inside a comment's subtree. It's own-only, reusing the viewer gate from pearl-edit-current-comment: a comment authored by someone else, a bot, or an integration is refused with no commentDelete call. It confirms before the destructive mutation, and on success removes that comment's Org subtree, leaving sibling comments and the issue body untouched. pearl--delete-comment-async mirrors pearl--delete-issue-async. The delete is permanent. I verified Linear's commentDelete against the live API: the comment is not found immediately after, with no restore path, so unlike issueDelete this isn't a recoverable soft delete. Because of that, a comment with unsaved local edits (or no stored hash) gets a stronger "discard your local edits" confirmation rather than the plain prompt. I surfaced it as K in the transient Delete group and as d c in the prefix keymap, and inverted the keymap test that asserted d c was unbound. --- tests/test-pearl-keymap.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/test-pearl-keymap.el') diff --git a/tests/test-pearl-keymap.el b/tests/test-pearl-keymap.el index 97d8440..260b6fa 100644 --- a/tests/test-pearl-keymap.el +++ b/tests/test-pearl-keymap.el @@ -66,9 +66,9 @@ Walks MAP looking for a labeled binding (\"label\" . COMMAND)." (should (keymapp (lookup-key pearl-prefix-map (kbd "n")))) (should (keymapp (lookup-key pearl-prefix-map (kbd "d"))))) -(ert-deftest test-pearl-prefix-map-no-delete-comment-yet () - "Delete-comment is not bound -- the command is a separate task." - (should-not (commandp (lookup-key pearl-prefix-map (kbd "d c"))))) +(ert-deftest test-pearl-prefix-map-delete-comment-bound () + "Delete-comment fills the d c slot under the delete prefix." + (should (eq 'pearl-delete-current-comment (lookup-key pearl-prefix-map (kbd "d c"))))) (ert-deftest test-pearl-prefix-map-not-bound-at-load () "Loading pearl does not bind the commands to any active key (opt-in)." -- cgit v1.2.3