unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [RFC PATCH v5 00/11] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag
@ 2012-02-15  9:03 Mark Walters
  2012-02-15  9:03 ` [RFC PATCH v5 01/11] cli: add --no-exclude option to count and search Mark Walters
                   ` (12 more replies)
  0 siblings, 13 replies; 24+ messages in thread
From: Mark Walters @ 2012-02-15  9:03 UTC (permalink / raw)
  To: notmuch

This is v5 of the exclude flag series. (v4 was at 
id:"874nv9rv79.fsf@qmul.ac.uk")

This email has 4 sections, an overview of what the patch set is 
trying to achieve, a summary of the changes from v4, some comments on 
the status of the patches in the series and some remaining queries.

OVERVIEW

The current implementation of exclude-tags does not use excludes in
notmuch-show.c (and thus not in notmuch-show.el). Thus when selecting 
a thread in the search view claiming one matched message you may get 
several matches in show all but one of which are tagged excluded.

The trivial change of adding excludes to show does not work as easily 
as one would like. For example if you try notmuch-show 
id:<deleted message> you get no results (see 
id:"871uqvgrnm.fsf@qmul.ac.uk" for more discussion).

This set moves in a different direction. It returns all the results 
but marks excluded messages with a new flag 
(NOTMUCH_MESSAGE_FLAG_EXCLUDED) and lets the consumer decide what to 
do with them. For example it could start with the message closed in 
emacs show view, it could colour the headerline differently etc.

CHANGES:
This has been rebased on top of Jani's notmuch-show command line 
parsing patch.

The function notmuch_thread_get_flag_messages function added in v4
has been removed. Unfortunately (as Austin pointed out) that patch 
broke binary compatibility so should be deferred until we wish to 
bump the library version.

I also fixed a minor bug and a style comment in the emacs part of 
the patch.

STATUS:
The first 3 patches in the series just add a --no-exclude option
to notmuch-search.c and notmuch-count.c to "turn off" the excluding.
(The 3 patches are one for the C code, one for the man pages and 
one for the tests.) I think this change is desirable independently 
of the rest of the series (and indeed Jameson had a use for it
id:"878vk943ci.fsf@servo.finestructure.net").

QUERIES

1) As with v4 the api notmuch_query_set_omit_excluded_messages
remains: without it I can't see how a user can pass a 
notmuch_messages_t object around which does not contain the 
excluded messages. See id:"87fweusabh.fsf@qmul.ac.uk". 

2)  If we have a query which overrides the excludes such as "blah and
tag:deleted" should the tag:deleted messages still be marked excluded?
The current implementation does mark them excluded but my preference 
would be not to. What do people think? At the moment 2 tests fail but 
the correct output depends on the above so I will leave them until we
have a decision on this.

There are some other queries mentioned in v4 but the two above are
the significant ones.

Best wishes

Mark



Mark Walters (11):
  cli: add --no-exclude option to count and search.
  cli: Add --no-exclude to the man pages for search and count
  test: add tests for new cli --no-exclude option
  lib: Rearrange the exclude code in query.cc
  lib: Make notmuch_query_search_messages set the exclude flag
  lib: Add the exclude flag to notmuch_query_search_threads
  cli: Make notmuch-show respect excludes.
  man: update manpage for notmuch-show --no-exclude option
  test: update tests to reflect the exclude flag
  cli: omit excluded messages in results where appropriate.
  emacs: show: recognize the exclude flag.

 emacs/notmuch-show.el     |   19 +++++++++++-
 lib/notmuch-private.h     |    8 ++++-
 lib/notmuch.h             |   16 ++++++++--
 lib/query.cc              |   74 ++++++++++++++++++++++++++++++++++++++------
 lib/thread.cc             |   18 +++++++++--
 man/man1/notmuch-count.1  |    7 ++++
 man/man1/notmuch-search.1 |    7 ++++
 man/man1/notmuch-show.1   |    7 ++++
 notmuch-count.c           |   19 ++++++++----
 notmuch-search.c          |   26 ++++++++++++----
 notmuch-show.c            |   31 ++++++++++++++++--
 test/count                |   21 +++++++++++++
 test/crypto               |    9 +++++-
 test/encoding             |    2 +-
 test/json                 |    6 ++--
 test/maildir-sync         |    1 +
 test/multipart            |    4 +-
 test/search               |    5 +++
 test/thread-naming        |   16 +++++-----
 19 files changed, 246 insertions(+), 50 deletions(-)

-- 
1.7.2.3

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-02-24 23:58 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [RFC PATCH v5 11/11] emacs: show: recognize the exclude flag Mark Walters
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

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).