aboutsummaryrefslogtreecommitdiff
path: root/piem-notmuch.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-02-07 02:57:34 -0500
committerKyle Meyer <kyle@kyleam.com>2021-02-07 12:38:50 -0500
commite06a50377649da9af7a804ba225b400c87e11d40 (patch)
tree9c402d4410bcfd78bba12179ddd90dba5121e74b /piem-notmuch.el
parent0a3de9e528c010e3f8ff113eaca28f10ad0528ca (diff)
downloadpiem-e06a50377649da9af7a804ba225b400c87e11d40.tar.gz
piem: Add helper to construct message ID link
There are two spots that use (piem-inbox-get :url ...) and piem-escape-mid to construct the public-inbox link, and there is about to be another. Extract this shared logic. Cc: Xinglu Chen <public@yoctocell.xyz> Message-Id: <20210207075738.8752-2-kyle@kyleam.com>
Diffstat (limited to 'piem-notmuch.el')
-rw-r--r--piem-notmuch.el10
1 files changed, 3 insertions, 7 deletions
diff --git a/piem-notmuch.el b/piem-notmuch.el
index a222f3f..2a5c525 100644
--- a/piem-notmuch.el
+++ b/piem-notmuch.el
@@ -109,13 +109,9 @@ message itself if it looks like a patch."
(defun piem-notmuch-show-get-public-inbox-link (mid)
"Given the message-id MID, return the public-inbox url.
This will lookup the url in the `piem-inboxes' variable."
- (let* ((inbox (or (piem-notmuch-get-inbox)
- (user-error "No inbox associated with current buffer")))
- (link (or (piem-inbox-get :url inbox)
- (user-error "No url was found for %s" inbox))))
- (concat
- (piem--ensure-trailing-slash link)
- (piem-escape-mid mid))))
+ (piem-mid-url mid
+ (or (piem-notmuch-get-inbox)
+ (user-error "No inbox associated with current buffer"))))
;;;###autoload
(define-minor-mode piem-notmuch-mode