search summary and exclusions

Mark Walters markwalters1009 at gmail.com
Wed May 30 00:49:31 PDT 2012


On Wed, 30 May 2012, Peter Wang <novalazy at gmail.com> wrote:
> On Tue, 29 May 2012 08:00:00 -0700, Jameson Graef Rollins <jrollins at finestructure.net> wrote:
>> On Mon, May 28 2012, Peter Wang <novalazy at gmail.com> wrote:
>> > % ./notmuch search --format=json --exclude=true -- thread:0000000000009598 tag:unread
>> > [{"thread": "0000000000009598",
>> > "timestamp": 1338231998,
>> > "date_relative": "Today 05:06",
>> > "matched": 1,
>> > "total": 15,
>> > "authors": "Mark Walters| Peter Wang",
>> > "subject": "[PATCH v6 3/6] cli: make --entire-thread=false work for format=json.",
>> > "tags": ["deleted", "draft", "replied", "sent", "unread"]}]
>> >
>> > Here is a thread I participated in.  From this, my MUA displays "1/15",
>> > suggesting that there is 1 unread message out of a total of 15.  But
>> > upon opening the thread, there are only 11 messages visible: 4 were
>> > drafts (possibly deleted) which have been excluded.  To the user, it
>> > looks like some messages went missing.
>> >
>> > Therefore I would like search --output=summary --exclude=true
>> > to report the total number of non-excluded messages.  It doesn't need to
>> > be via the "total" field; a new field would be fine.
>> 
>> What you have pasted above is --output=json, not --output=summary.  The
>> formats are quite different.  What are you asking for a change in?
>
> --output=summary is the default.  --format=json only changes the
> surface syntax.
>
> % ./notmuch search --output=summary --exclude=true -- thread:0000000000009598 tag:unread
> thread:0000000000009598  Yest. 05:06 [1/15] Mark Walters| Peter Wang; [PATCH v6 3/6] cli: make --entire-thread=false work for format=json. (deleted draft replied sent unread)
>
>> But regardless, I don't think I would like to see the changes you
>> suggest.  I would like for the thread total to list the total number of
>> messages in the thread, regardless whether they're excluded or not.
>> Same for the tags.  I think I want to continue to see if excluded
>> messages are in a returned thread.  The desire to hide the excluded
>> messages in the output is why they're marked as hidden/not visible.
>> 
>> Think about the excludes as acting on the search itself, and less on the
>> output.  We exclude messages from search, but if they show up in a
>> returned thread we at least acknowledge that they're there.
>
> Understood; it's a two-phase process, and I wasn't making the
> distinction.  If it is the expected and useful behaviour, so be it.
>
> Maybe there is room for another keyword under --exclude?

Yes that might be the best way to go. Something like --exclude=all and
then excluded messages never appear anywhere?

I think it should be easy: I will try to send a patch tonight.

Best wishes

Mark


More information about the notmuch mailing list