(message (if notmuch-show-process-crypto
"Processing cryptographic MIME parts."
"Not processing cryptographic MIME parts."))
- (notmuch-show-refresh-view t))
+ (notmuch-show-refresh-view))
(defun notmuch-show-toggle-elide-non-matching ()
"Toggle the display of non-matching messages."
(message (if notmuch-show-elide-non-matching-messages
"Showing matching messages only."
"Showing all messages."))
- (notmuch-show-refresh-view t))
+ (notmuch-show-refresh-view))
(defun notmuch-show-toggle-thread-indentation ()
"Toggle the indentation of threads."
(message (if notmuch-show-indent-content
"Content is indented."
"Content is not indented."))
- (notmuch-show-refresh-view t))
+ (notmuch-show-refresh-view))
(defun notmuch-show-insert-tree (tree depth)
"Insert the message tree TREE at depth DEPTH in the current thread."
(setq notmuch-show-thread-id thread-id
notmuch-show-parent-buffer parent-buffer
notmuch-show-query-context query-context)
- (notmuch-show-worker)))
+ (notmuch-show-build-buffer)
-(defun notmuch-show-worker ()
+ ;; Move to the first open message and mark it read
+ (if (notmuch-show-message-visible-p)
+ (notmuch-show-mark-read)
+ (notmuch-show-next-open-message))))
+
+(defun notmuch-show-build-buffer ()
(let ((inhibit-read-only t))
(notmuch-show-mode)
(run-hooks 'notmuch-show-hook))
- ;; Move straight to the first open message
- (unless (notmuch-show-message-visible-p)
- (notmuch-show-next-open-message))
-
- ;; Set the header line to the subject of the first open message.
- (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject)))
-
- (notmuch-show-mark-read)))
+ ;; Set the header line to the subject of the first message.
+ (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject)))))
(defun notmuch-show-capture-state ()
"Capture the state of the current buffer.
(message "Previously current message not found."))
(notmuch-show-message-adjust)))
-(defun notmuch-show-refresh-view (&optional retain-state)
+(defun notmuch-show-refresh-view (&optional reset-state)
"Refresh the current view.
Refreshes the current view, observing changes in display
-preferences. If RETAIN-STATE is non-nil then the state of the
-buffer is stored and re-applied after the refresh."
+preferences. If invoked with a prefix argument (or RESET-STATE is
+non-nil) then the state of the buffer (open/closed messages) is
+reset based on the original query."
(interactive "P")
(let ((inhibit-read-only t)
- state)
- (if retain-state
- (setq state (notmuch-show-capture-state)))
+ (state (unless reset-state
+ (notmuch-show-capture-state))))
(erase-buffer)
- (notmuch-show-worker)
+ (notmuch-show-build-buffer)
(if state
- (notmuch-show-apply-state state))))
+ (notmuch-show-apply-state state)
+ ;; We're resetting state, so navigate to the first open message
+ ;; and mark it read, just like opening a new show buffer.
+ (if (notmuch-show-message-visible-p)
+ (notmuch-show-mark-read)
+ (notmuch-show-next-open-message)))))
(defvar notmuch-show-stash-map
(let ((map (make-sparse-keymap)))
(apply 'notmuch-show-tag-message tag-changes)))
(defun notmuch-show-tag-all (&rest tag-changes)
- "Change tags for all messages in the current thread.
+ "Change tags for all messages in the current buffer.
TAG-CHANGES is a list of tag operations for `notmuch-tag'."
(interactive (notmuch-read-tag-changes nil notmuch-show-thread-id))
(notmuch-show-tag-all (concat op "inbox"))))
(defun notmuch-show-archive-thread-then-next ()
- "Archive each message in thread, then show next thread from search."
+ "Archive all messages in the current buffer, then show next thread from search."
(interactive)
(notmuch-show-archive-thread)
(notmuch-show-next-thread t))
(defun notmuch-show-archive-thread-then-exit ()
- "Archive each message in thread, then exit back to search results."
+ "Archive all messages in the current buffer, then exit back to search results."
(interactive)
(notmuch-show-archive-thread)
(notmuch-show-next-thread))