notmuch-show: add notmuch-show-mark-read-tags option

The `notmuch-show-mark-read-tags' lists tags that are to be applied when
message is read.  By default, the only value is "-unread" which will remove
the unread tag.  Among other uses, this variable can be used to stop
notmuch-show from modifying tags when message is shown (by setting the
variable to an empty list).
This commit is contained in:
Michal Nazarewicz 2012-08-21 15:13:36 +02:00 committed by David Bremner
parent 474ea348cf
commit 1f30f7d290

View file

@ -183,6 +183,13 @@ provided with an MLA argument nor `completing-read' input."
notmuch-show-stash-mlarchive-link-alist)) notmuch-show-stash-mlarchive-link-alist))
:group 'notmuch-show) :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."
:type '(repeat string)
:group 'notmuch-show)
(defmacro with-current-notmuch-show-message (&rest body) (defmacro with-current-notmuch-show-message (&rest body)
"Evaluate body with current buffer set to the text of current message" "Evaluate body with current buffer set to the text of current message"
`(save-excursion `(save-excursion
@ -1383,8 +1390,9 @@ current thread."
(notmuch-show-get-prop :headers-visible)) (notmuch-show-get-prop :headers-visible))
(defun notmuch-show-mark-read () (defun notmuch-show-mark-read ()
"Mark the current message as read." "Apply `notmuch-show-mark-read-tags' to the message."
(notmuch-show-tag-message "-unread")) (when notmuch-show-mark-read-tags
(apply 'notmuch-show-tag-message notmuch-show-mark-read-tags)))
;; Functions for getting attributes of several messages in the current ;; Functions for getting attributes of several messages in the current
;; thread. ;; thread.