From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [Patch v4 1/3] emacs: split notmuch-show-apply-state
Date: Sun, 29 Apr 2012 01:06:44 +0100 [thread overview]
Message-ID: <1335658006-20161-2-git-send-email-markwalters1009@gmail.com> (raw)
In-Reply-To: <1335658006-20161-1-git-send-email-markwalters1009@gmail.com>
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.
---
emacs/notmuch-show.el | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 30b26d1..3bd9a64 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1085,6 +1085,16 @@ This includes:
- the current message."
(list (notmuch-show-get-message-id) (notmuch-show-get-message-ids-for-open-messages)))
+(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.
@@ -1102,13 +1112,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.
--
1.7.9.1
next prev parent reply other threads:[~2012-04-29 0:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-29 0:06 [Patch v4 0/3] Add filter to emacs show mode Mark Walters
2012-04-29 0:06 ` Mark Walters [this message]
2012-04-29 0:57 ` [Patch v4 1/3] emacs: split notmuch-show-apply-state Austin Clements
2012-04-29 0:06 ` [Patch v4 2/3] emacs: add a filter option to show Mark Walters
2012-04-29 0:06 ` [Patch v4 3/3] emacs: Bind filter in search to 'l' Mark Walters
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1335658006-20161-2-git-send-email-markwalters1009@gmail.com \
--to=markwalters1009@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).