[RFC PATCH v5 00/11] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag

Jameson Graef Rollins jrollins at finestructure.net
Wed Feb 15 14:16:16 PST 2012


On Wed, 15 Feb 2012 21:11:15 +0000, Mark Walters <markwalters1009 at gmail.com> wrote:
> I think the difficulty is that there are lots of annoying corner cases,
> but if there is a  simpler solution that would be great!

I think there is!

> 1) What should notmuch show id:deleted-message-id do? 
> 
> It could return the thread containing the deleted message. If it does
> return a thread what subject does it assign it?  Possibly it could
> return no messages and the caller would have to call it again with
> --no-exclude.

"notmuch show id:<excluded-id>" should always return the message
matching id:<excluded-id> with match=true.  In fact, any search that
references a specific id: should always process the message as if there
were no excludes at all.

Excluded messages are not directly accessible at the moment, which is
definitely a bug.  Adding the --no-excludes option will help, but I
still think we should just implement the behavior I outline above.

> 2) Should notmuch search return threads which match but only in excluded
> messages? 
> 
> If yes then does it sort it based on match or match-not-excluded? If the
> latter what happens to threads with no match-not-excluded messages? If
> not then does searching for id:deleted-message return no results? The
> caller could try with --no-exclude, but then the caller would end up
> returning the deleted message for search id:deleted-message but not for
> search id:deleted-message or id:some-other-not-deleted-message.

See the point above.  If one of the search terms is an id: then that
message should be returned matched, as if there were no excludes.

I think this is the right solution, for both search and show:

- excluded messages are just match=false

- searches that reference a specific id: are match=true no matter what
  their exclude status

- searches that reference an excluded tag are match=true

As far as I can see this should "just work", without any existing
changes to consumers.  Anyone see any issues I'm missing?

jamie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120215/8e3bcb27/attachment.pgp>


More information about the notmuch mailing list