aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-02-07 02:57:35 -0500
committerKyle Meyer <kyle@kyleam.com>2021-02-07 12:38:50 -0500
commita369256fb94b4f61db06607500d26aaf01b9e5ea (patch)
tree801d03ad0b5d0701b196ae9a245361a00c17a22b
parente06a50377649da9af7a804ba225b400c87e11d40 (diff)
downloadpiem-a369256fb94b4f61db06607500d26aaf01b9e5ea.tar.gz
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>
-rw-r--r--piem.el17
1 files 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)]])