From a369256fb94b4f61db06607500d26aaf01b9e5ea Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 7 Feb 2021 02:57:35 -0500 Subject: piem-dispatch: Add command for copying public-inbox URLs piem-notmuch configures notmuch-show-stash-mlarchive-link-alist with a custom piem function that's useful for grabbing the pubic-inbox URL. Add a command to piem-dispatch that provides similar functionality. Message-Id: <20210207075738.8752-3-kyle@kyleam.com> --- piem.el | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/piem.el b/piem.el index 24d252e..0ed288a 100644 --- a/piem.el +++ b/piem.el @@ -467,6 +467,16 @@ INBOX is nil, use the inbox returned by `piem-inbox'." (or inbox "current buffer")))) (piem-escape-mid mid))) +(defun piem-copy-mid-url () + "Copy public-inbox URL for the current buffer's message." + (interactive) + (kill-new + (message "%s" + (piem-mid-url + (or (piem-mid) + (user-error "No message ID found for the current buffer")) + (piem-inbox))))) + ;;;; Download helpers @@ -787,9 +797,10 @@ this triggers the creation of a new worktree." ;;;###autoload (autoload 'piem-dispatch "piem" nil t) (define-transient-command piem-dispatch () "Invoke a piem command." - [("a" "apply patch" piem-am) - ("b" "call b4-am" piem-b4-am) - ("i" "inject thread into maildir" piem-inject-thread-into-maildir)]) + [[("a" "apply patch" piem-am) + ("b" "call b4-am" piem-b4-am)] + [("i" "inject thread into maildir" piem-inject-thread-into-maildir) + ("l" "copy public-inbox link" piem-copy-mid-url)]]) -- cgit v1.2.3