From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org, Austin Clements <amdragon@MIT.EDU>
Subject: [Patch v6 13/13] emacs: notmuch.el ignore excluded matches
Date: Sat, 25 Feb 2012 08:06:44 +0000 [thread overview]
Message-ID: <1330157204-26094-14-git-send-email-markwalters1009@gmail.com> (raw)
In-Reply-To: <1330157204-26094-1-git-send-email-markwalters1009@gmail.com>
This is a small change to make notmuch.el ignore excluded matches. In
the future it could do something better like add a button for
rerunning the search with the excludes (particularly if nothing
matches with the excludes) or having them invisible and allowing the
visibility to be toggled.
It is a 1 or 2 line change except for indentation.
---
emacs/notmuch.el | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 5b4f1c5..8b209cd 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -865,16 +865,18 @@ non-authors is found, assume that all of the authors match."
(goto-char (point-max))
(if (/= (match-beginning 1) line)
(insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n")))
- (let ((beg (point)))
- (notmuch-search-show-result date count authors
- (notmuch-prettify-subject subject) tags)
- (notmuch-search-color-line beg (point) tag-list)
- (put-text-property beg (point) 'notmuch-search-thread-id thread-id)
- (put-text-property beg (point) 'notmuch-search-authors authors)
- (put-text-property beg (point) 'notmuch-search-subject subject)
- (when (string= thread-id notmuch-search-target-thread)
- (set 'found-target beg)
- (set 'notmuch-search-target-thread "found")))
+ ;; We currently just throw away excluded matches.
+ (unless (eq (aref count 1) ?0)
+ (let ((beg (point)))
+ (notmuch-search-show-result date count authors
+ (notmuch-prettify-subject subject) tags)
+ (notmuch-search-color-line beg (point) tag-list)
+ (put-text-property beg (point) 'notmuch-search-thread-id thread-id)
+ (put-text-property beg (point) 'notmuch-search-authors authors)
+ (put-text-property beg (point) 'notmuch-search-subject subject)
+ (when (string= thread-id notmuch-search-target-thread)
+ (set 'found-target beg)
+ (set 'notmuch-search-target-thread "found"))))
(set 'line (match-end 0)))
(set 'more nil)
(while (and (< line (length string)) (= (elt string line) ?\n))
--
1.7.2.3
next prev parent reply other threads:[~2012-02-26 5:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-25 8:06 [Patch v6 00/13] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag Mark Walters
2012-02-25 8:06 ` [Patch v6 01/13] cli: add --no-exclude option to count and search Mark Walters
2012-02-25 8:06 ` [Patch v6 02/13] cli: Add --no-exclude to the man pages for search and count Mark Walters
2012-02-25 8:06 ` [Patch v6 03/13] test: add tests for new cli --no-exclude option Mark Walters
2012-02-25 8:06 ` [Patch v6 04/13] lib: Rearrange the exclude code in query.cc Mark Walters
2012-02-25 8:06 ` [Patch v6 05/13] lib: Make notmuch_query_search_messages set the exclude flag Mark Walters
2012-02-25 8:06 ` [Patch v6 06/13] lib: Add the exclude flag to notmuch_query_search_threads Mark Walters
2012-02-25 8:06 ` [Patch v6 07/13] test: update search test to reflect exclude flag Mark Walters
2012-02-25 8:06 ` [Patch v6 08/13] cli: Make notmuch-show respect excludes Mark Walters
2012-02-25 8:06 ` [Patch v6 09/13] test: update tests to reflect the exclude flag Mark Walters
2012-02-25 8:06 ` [Patch v6 10/13] man: update manpage for notmuch-show --no-exclude option Mark Walters
2012-02-25 8:06 ` [Patch v6 11/13] cli: omit excluded messages in results where appropriate Mark Walters
2012-02-25 8:06 ` [Patch v6 12/13] emacs: show: recognize the exclude flag Mark Walters
2012-02-29 9:17 ` Mark Walters
2012-02-25 8:06 ` Mark Walters [this message]
2012-02-27 22:39 ` [Patch v6 00/13] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag 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=1330157204-26094-14-git-send-email-markwalters1009@gmail.com \
--to=markwalters1009@gmail.com \
--cc=amdragon@MIT.EDU \
--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).