Wael Nasreddine <wael.nasreddine at gmail.com> writes: > Hey guys, > > I am trying to exclude any thread that has the tag *killed* but it's > either a bug or something that I am simply doing wrong. > > $ notmuch search tag:work and tag:unread and tag:inbox and not tag:killed | > grep 'killed' | wc -l > 1 > > I am getting the same result with Trusty shipped notmuch v0.17 and with > today's build. >
Search works by matching messages. So if you have a thread with at least one message which does not have that tag, that thread will still show up in a "not tag:killed" search. The way I maintain killed threads is to search for tag:killed, and then call notmuch tag -inbox -unread for all those threads. Here's my code to do this: # killed threads for th in $(notmuch search --output=threads -- tag:killed); do notmuch tag -inbox -unread -new -- $th done -- regards, kushal -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 472 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20140516/a6f818e5/attachment.pgp>