aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Jani Nikula <jani@nikula.org>2012-09-06 18:32:42 +0300
committerGravatar David Bremner <bremner@debian.org>2012-09-19 08:06:12 -0300
commit8a22e2875049b47ebf7058e93bd2d12747838519 (patch)
tree00cc19776adfec576e97f261d2954bd0b3a84c00 /emacs
parent1548751041d6d19984611e0868dfcb9553b850e7 (diff)
emacs: add support for reversing notmuch-show-mark-read tag changes
Since marking a message as read can now be a user customized set of tag changes, make reversing this easier. Allow a prefix argument to notmuch-show-mark-read to reverse the marking as read, similar to the unarchiving in notmuch-show-archive-message. While at it, update the relevant documentation to match that of other automatic tagging (i.e. archive and reply).
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-show.el25
1 files changed, 20 insertions, 5 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index e701aec3..1c1cf9c7 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -184,8 +184,15 @@ provided with an MLA argument nor `completing-read' input."
:group 'notmuch-show)
(defcustom notmuch-show-mark-read-tags '("-unread")
- "List of tags to apply when message is read, ie. shown in notmuch-show
-buffer."
+ "List of tag changes to apply to a message when it is marked as read.
+
+Tags starting with \"+\" (or not starting with either \"+\" or
+\"-\") in the list will be added, and tags starting with \"-\"
+will be removed from the message being marked as read.
+
+For example, if you wanted to remove an \"unread\" tag and add a
+\"read\" tag (which would make little sense), you would set:
+ (\"-unread\" \"+read\")"
:type '(repeat string)
:group 'notmuch-show)
@@ -1390,10 +1397,18 @@ current thread."
"Are the headers of the current message visible?"
(notmuch-show-get-prop :headers-visible))
-(defun notmuch-show-mark-read ()
- "Apply `notmuch-show-mark-read-tags' to the message."
+(defun notmuch-show-mark-read (&optional unread)
+ "Mark the current message as read.
+
+Mark the current message as read by applying the tag changes in
+`notmuch-show-mark-read-tags' to it (remove the \"unread\" tag by
+default). If a prefix argument is given, the message will be
+marked as unread, i.e. the tag changes in
+`notmuch-show-mark-read-tags' will be reversed."
+ (interactive "P")
(when notmuch-show-mark-read-tags
- (apply 'notmuch-show-tag-message notmuch-show-mark-read-tags)))
+ (apply 'notmuch-show-tag-message
+ (notmuch-tag-change-list notmuch-show-mark-read-tags unread))))
;; Functions for getting attributes of several messages in the current
;; thread.