From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [RFC PATCH v5 11/11] emacs: show: recognize the exclude flag.
Date: Wed, 15 Feb 2012 09:03:39 +0000 [thread overview]
Message-ID: <1329296619-7463-12-git-send-email-markwalters1009@gmail.com> (raw)
In-Reply-To: <1329296619-7463-1-git-send-email-markwalters1009@gmail.com>
Show mode will recognize the exclude flag by not opening excluding
messages by default, and will start at the first matching non-excluded
message. If there are no matching non-excluded messages it will go to
the first matching (necessarily excluded) message.
---
emacs/notmuch-show.el | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index aa9ccee..96b0c71 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -948,7 +948,8 @@ current buffer, if possible."
;; Message visibility depends on whether it matched the search
;; criteria.
- (notmuch-show-message-visible msg (plist-get msg :match))))
+ (notmuch-show-message-visible msg (and (plist-get msg :match)
+ (not (plist-get msg :excluded))))))
(defun notmuch-show-toggle-process-crypto ()
"Toggle the processing of cryptographic MIME parts."
@@ -1079,6 +1080,10 @@ function is used."
;; Move straight to the first open message
(unless (notmuch-show-message-visible-p)
(notmuch-show-next-open-message))
+ (when (eobp)
+ (goto-char (point-min))
+ (unless (notmuch-show-get-prop :match)
+ (notmuch-show-next-matching-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)))
@@ -1557,6 +1562,18 @@ to show, nil otherwise."
(goto-char (point-max))))
r))
+(defun notmuch-show-next-matching-message ()
+ "Show the next matching message."
+ (interactive)
+ (let (r)
+ (while (and (setq r (notmuch-show-goto-message-next))
+ (not (notmuch-show-get-prop :match))))
+ (if r
+ (progn
+ (notmuch-show-mark-read)
+ (notmuch-show-message-adjust))
+ (goto-char (point-max)))))
+
(defun notmuch-show-previous-open-message ()
"Show the previous open message."
(interactive)
--
1.7.2.3
next prev parent reply other threads:[~2012-02-15 9:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-15 9:03 [RFC PATCH v5 00/11] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag Mark Walters
2012-02-15 9:03 ` [RFC PATCH v5 01/11] cli: add --no-exclude option to count and search Mark Walters
2012-02-24 23:03 ` Austin Clements
2012-02-15 9:03 ` [RFC PATCH v5 02/11] cli: Add --no-exclude to the man pages for search and count Mark Walters
2012-02-24 23:05 ` Austin Clements
2012-02-15 9:03 ` [RFC PATCH v5 03/11] test: add tests for new cli --no-exclude option Mark Walters
2012-02-15 9:03 ` [RFC PATCH v5 04/11] lib: Rearrange the exclude code in query.cc Mark Walters
2012-02-15 9:03 ` [RFC PATCH v5 05/11] lib: Make notmuch_query_search_messages set the exclude flag Mark Walters
2012-02-24 23:39 ` Austin Clements
2012-02-15 9:03 ` [RFC PATCH v5 06/11] lib: Add the exclude flag to notmuch_query_search_threads Mark Walters
2012-02-15 9:03 ` [RFC PATCH v5 07/11] cli: Make notmuch-show respect excludes Mark Walters
2012-02-15 9:03 ` [RFC PATCH v5 08/11] man: update manpage for notmuch-show --no-exclude option Mark Walters
2012-02-24 23:44 ` Austin Clements
2012-02-15 9:03 ` [RFC PATCH v5 09/11] test: update tests to reflect the exclude flag Mark Walters
2012-02-24 23:47 ` Austin Clements
2012-02-15 9:03 ` [RFC PATCH v5 10/11] cli: omit excluded messages in results where appropriate Mark Walters
2012-02-15 9:03 ` Mark Walters [this message]
2012-02-15 17:46 ` [RFC PATCH v5 00/11] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag Jameson Graef Rollins
2012-02-15 18:10 ` Jameson Graef Rollins
2012-02-15 21:11 ` Mark Walters
2012-02-15 22:16 ` Jameson Graef Rollins
2012-02-15 23:59 ` Austin Clements
2012-02-16 0:30 ` Mark Walters
2012-02-24 23:58 ` Austin Clements
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=1329296619-7463-12-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).