notmuch and "mute" -- useful to anyone?

Matt Armstrong marmstrong at google.com
Wed Aug 3 10:33:01 PDT 2016


David Bremner <david at tethera.net> writes:

> Matt Armstrong <marmstrong at google.com> writes:
>
>> Is anyone else interested in Gmail-like "mute" support in notmuch.el?
>> If so, I can think about polishing the below off and adding it to
>> notmuch.
>>
>> I've managed to implement Gmail's "mute" in notmuch as follows in my
>> notmuch-post-new:
>>
>> ----------------------------------------------------------------------
>> # Unmute all threads with new messages sent to me.
>> notmuch search --output=threads tag:new AND tag:me | \
>>   xargs --no-run-if-empty notmuch tag -muted --
>>
>> # Remove all muted threads from the inbox and mark every message in them
>> # muted.  Ideally this would be atomic with the above.
>> notmuch search --output=threads tag:muted | \
>>   xargs --no-run-if-empty notmuch tag -inbox +muted --
>> ----------------------------------------------------------------------
>
> See also the example of https://notmuchmail.org/excluding/
>
> This kind of thing is what message exclusion is invented for.
>
> I guess you have to adjust to get precisely the semantics you want where
> messages specifically to you are not muted.

"mute" is a bit odd.  It is essentially "new messages in this thread
skip the inbox".  It is a property of a thread, not a message.

It has little to do with excluding messages from arbitrary searches.  In
particular, muted threads should show up in normal free text searches.
I don't think message exclusion is the right mechanism.

The spec is: when a message arrives,
  if it is "to me" unmute any thread it is part of
  otherwise if it is in a muted thread, avoid tagging it "inbox"

This is a little bit hard to deal with in a the notmuch model, which
deals more naturally with mechanisms that tag individual messages and
handles threading as a post-search message gathering step (as far as I
can tell).

I'm not claiming that what I've got is optimal -- it feels like a hack
to me, but is the best I came up with.


More information about the notmuch mailing list