aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Pieter Praet <pieter@praet.org>2012-02-19 21:50:25 +0100
committerGravatar David Bremner <bremner@debian.org>2012-02-25 10:33:18 -0400
commit16ba777fd2a6dc6e9ade1f3894f5d7a001464a53 (patch)
treeb0e9ad40d2d47ebb1c14f6f8d1ec8ec41b9b1537 /emacs
parent327892f5966157427f9f9081474eefec665c37fb (diff)
emacs: `notmuch-show-get-message-id': optionally return Message-Id sans prefix
* emacs/notmuch-show.el (notmuch-show-get-message-id): Add optional arg BARE. When non-nil, return a Message-Id without quotes and prefix, thus obviating the need to strip them off again in various places. (notmuch-show-stash-message-id-stripped): Update wrt changes in `notmuch-show-get-message-id'.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-show.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f35513b9..529b674e 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1333,9 +1333,14 @@ Some useful entries are:
(notmuch-show-get-message-properties))))
(plist-get props prop)))
-(defun notmuch-show-get-message-id ()
- "Return the message id of the current message."
- (concat "id:\"" (notmuch-show-get-prop :id) "\""))
+(defun notmuch-show-get-message-id (&optional bare)
+ "Return the Message-Id of the current message.
+
+If optional argument BARE is non-nil, return
+the Message-Id without prefix and quotes."
+ (if bare
+ (notmuch-show-get-prop :id)
+ (concat "id:\"" (notmuch-show-get-prop :id) "\"")))
(defun notmuch-show-get-messages-ids ()
"Return all message ids of messages in the current thread."
@@ -1793,7 +1798,7 @@ thread from search."
(defun notmuch-show-stash-message-id-stripped ()
"Copy message ID of current message (sans `id:' prefix) to kill-ring."
(interactive)
- (notmuch-common-do-stash (substring (notmuch-show-get-message-id) 4 -1)))
+ (notmuch-common-do-stash (notmuch-show-get-message-id t)))
(defun notmuch-show-stash-subject ()
"Copy Subject field of current message to kill-ring."