X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-show.el;h=f273eb406cb0daf38aec0a3f13286df7a49a556f;hb=d86522637a7cd0455c127284ebccf3645d681441;hp=e701aec39ccbec8fc8afdf661d2a47443cad1a75;hpb=d5dcfc714e13256cb2084b30d3506a4abc990a51;p=notmuch diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index e701aec3..f273eb40 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -47,8 +47,8 @@ For an open message, all of these headers will be made visible according to `notmuch-message-headers-visible' or can be toggled -with `notmuch-show-toggle-headers'. For a closed message, only -the first header in the list will be visible." +with `notmuch-show-toggle-visibility-headers'. For a closed message, +only the first header in the list will be visible." :type '(repeat string) :group 'notmuch-show) @@ -58,8 +58,8 @@ the first header in the list will be visible." If this value is non-nil, then all of the headers defined in `notmuch-message-headers' will be visible by default in the display of each message. Otherwise, these headers will be hidden and -`notmuch-show-toggle-headers' can be used to make the visible for -any given message." +`notmuch-show-toggle-visibility-headers' can be used to make them +visible for any given message." :type 'boolean :group 'notmuch-show) @@ -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) @@ -1070,10 +1077,10 @@ function is used." (jit-lock-register #'notmuch-show-buttonise-links) - (run-hooks 'notmuch-show-hook)) + ;; Set the header line to the subject of the first message. + (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject))) - ;; Set the header line to the subject of the first message. - (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject))))) + (run-hooks 'notmuch-show-hook)))) (defun notmuch-show-capture-state () "Capture the state of the current buffer. @@ -1163,7 +1170,7 @@ reset based on the original query." (define-key map "v" 'notmuch-show-view-all-mime-parts) (define-key map "c" 'notmuch-show-stash-map) (define-key map "=" 'notmuch-show-refresh-view) - (define-key map "h" 'notmuch-show-toggle-headers) + (define-key map "h" 'notmuch-show-toggle-visibility-headers) (define-key map "*" 'notmuch-show-tag-all) (define-key map "-" 'notmuch-show-remove-tag) (define-key map "+" 'notmuch-show-add-tag) @@ -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. @@ -1694,7 +1709,7 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." (interactive) (notmuch-show-tag "-")) -(defun notmuch-show-toggle-headers () +(defun notmuch-show-toggle-visibility-headers () "Toggle the visibility of the current message headers." (interactive) (let ((props (notmuch-show-get-message-properties)))