[notmuch] [PATCH 2/3] have _notmuch_thread_create mark which messages matched the query

Carl Worth cworth at cworth.org
Fri Nov 27 17:15:35 PST 2009


On Tue, 24 Nov 2009 23:54:34 -0500, Bart Trojanowski <bart at jukie.net> wrote:
> When _notmuch_thread_create() is given a query string, it can return more
> messages than just those matching the query.  To distinguish those that
> matched the query expression, the MATCHING_SEARCH flag is set
> appropriately.

This is a very useful feature, Bart. Thanks for coding it up. And it's a
nicely-implemented patch series as well.

I've pushed this out now, so anyone reading along should be able to try
it with:

./notmuch show thread:6d5e3e276461188c5778c9f219f63782 and subject:"PATCH 2/3"

I can't wait to have the emacs support for opening only matched messages
by default.

By the way, do you think that this support obviates the
--only-matching-messages option for "notmuch search" or does anyone
still want that?

Or maybe the right fix is to make "notmuch show" display only matching
messages by default, (which will likely be more friendly to a user
manually typing "notmuch show" at the command line). And then make the
user-interfaces pass an "--entire-thread" option (or so) to get the
current results.

If we're going to make the command-line user-interface usable on its
own, then I definitely want to make it be the user interfaces that have
to pass extra-long command-line options to get what they want.

One quick point on naming:

>  /* Message flags */
>  typedef enum _notmuch_message_flag {
> +    NOTMUCH_MSG_FLAG_MATCHING_SEARCH,
>  } notmuch_message_flag_t;

I like my enum values to match their type name without abbreviation. I
also like internals (like this enum value) to match the way they are
exposed in the interface, (which in this case is "match"). So I'd like
the above value to instead be:

	NOTMUCH_MESSAGE_FLAG_MATCH

-Carl


More information about the notmuch mailing list