aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Walters <markwalters1009@gmail.com>2015-06-13 09:08:08 +0100
committerDavid Bremner <david@tethera.net>2015-08-04 09:15:13 +0200
commitd4053be21acf4c3fce0b477e26eec95b42a36bd7 (patch)
tree4cdb68adf40da4d616a1600442e708e48112642b
parent6b440a0adf327fa9c3f5e3dcc84f9356c62a4580 (diff)
emacs: split notmuch-show-apply-state
Separate out a notmuch-show-goto-msg-id sub-function from notmuch-show-apply-state. There should be no functional change but the next patch will call the new function.
-rw-r--r--emacs/notmuch-show.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 2a53461e..a978d3c6 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1281,6 +1281,16 @@ This includes:
")")
notmuch-show-thread-id))
+(defun notmuch-show-goto-message (msg-id)
+ "Go to message with msg-id."
+ (goto-char (point-min))
+ (unless (loop if (string= msg-id (notmuch-show-get-message-id))
+ return t
+ until (not (notmuch-show-goto-message-next)))
+ (goto-char (point-min))
+ (message "Message-id not found."))
+ (notmuch-show-message-adjust))
+
(defun notmuch-show-apply-state (state)
"Apply STATE to the current buffer.
@@ -1298,13 +1308,7 @@ This includes:
until (not (notmuch-show-goto-message-next)))
;; Go to the previously open message.
- (goto-char (point-min))
- (unless (loop if (string= current (notmuch-show-get-message-id))
- return t
- until (not (notmuch-show-goto-message-next)))
- (goto-char (point-min))
- (message "Previously current message not found."))
- (notmuch-show-message-adjust)))
+ (notmuch-show-goto-message current)))
(defun notmuch-show-refresh-view (&optional reset-state)
"Refresh the current view.