From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id iJ9kI32dH2CWYAAAsNZ9tg (envelope-from ); Sun, 07 Feb 2021 07:57:49 +0000 Received: from out2.migadu.com ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yI/PD3udH2B+ZAAA1q6Kng (envelope-from ); Sun, 07 Feb 2021 07:57:47 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1612684667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A1hdtJe1XrxlnCdiHkMkNnjdFsMXTVWYs7ICQTcvyns=; b=oifulhgMiumYY4bH30odIzRy7xtKlQmm+dLDToWYJQf7Js5Wimuxibd4dCscuBUO9E79kE RMQ87jF7qGzIri9Obzri1/3O7ZBWxKrG/2Qoeq6em3/lkrSXZuZ3ir5GkF43SA/TtCKTyl NkS5XPFZPZLh9kEjKZw9FKf0nQ37W8vf8sPe3bY7HvYrEUOGKpz0jwDOTxtdSCGxDP4zTr eaKHhQoD+F8Pv25NUqa0sGSyfDXgK7E9KLFzT05KtE/JWtfQYYR1x3jxbfEirteUKNmcY9 SAoODEtIPmX5mseB69mfFXAO5damiET4UNX3rNGDCARaSCnAcc7a6HE18i7xPg== From: Kyle Meyer To: piem@inbox.kyleam.com Cc: Xinglu Chen Subject: [PATCH 2/5] piem-dispatch: Add command for copying public-inbox URLs Date: Sun, 7 Feb 2021 02:57:35 -0500 Message-Id: <20210207075738.8752-3-kyle@kyleam.com> In-Reply-To: <20210207075738.8752-1-kyle@kyleam.com> References: <20210207075738.8752-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-TUID: YPTQj6KGOn4l 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. --- 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 @@ (defun piem-mid-url (mid &optional 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 @@ (defun piem-am (mbox &optional format info coderepo toggle-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)]]) -- 2.30.0