unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michal Sojka <sojkam1@fel.cvut.cz>
To: Sebastian Spaeth <Sebastian@SSpaeth.de>,
	Notmuch developer list <notmuch@notmuchmail.org>
Subject: Re: hint: ignoring threads
Date: Wed, 24 Nov 2010 22:21:16 +0100	[thread overview]
Message-ID: <87sjyqbepf.fsf@steelpick.2x.cz> (raw)
In-Reply-To: <87lj4kavpa.fsf@SSpaeth.de>

On Tue, 23 Nov 2010, Sebastian Spaeth wrote:
> I like to ignore annoying threads, but notmuch has not easy way to
> achieve it, right? Well, it actually has...
> 
> 1) ok, in notmuch-show I read a message, decide the thread is uninteresting
> (or annoying) and tag that message as "ignore".
> 
> 2) Adding "and not tag:ignore in my saved searches doesn't help as there
> are still messages without tag ignore, so notmuch search will still show
> the threads. So I run this now after notmuch new: TADAA...
> 
> notmuch tag +ignore -- not tag:ignore and `notmuch search
> --output=threads tag:ignore`

You should use xargs to not reach the limit of the command line length.
Something like (not tested):

notmuch search --output=threads tag:ignore | xargs notmuch tag +ignore -- not tag:ignore and

> It seems to work, afterwords all messages in a thread where at least one
> message was tagges "ignore" will be tagged "ignore" and my saved
> searches suppress them.
> 
> Just wanted to share this tidbit as I can imagine plenty of usecases
> where a similar scheme could be handy.

In my view, this approach has a small disadvantage: the more threads
that are tagged as "ignore" the longer time is needed to search for
them.

Since I want my initial tagging script to be as fast as possible I use a
little bit different approach. My actual implementation is more
complicated than I show here, but it can be simplified as follows:

ignored_threads=$(notmuch search tag:new|grep ignore|cut -f 1 -d ' ')
notmuch tag -new $ignored_threads

I only search the new messages and use grep to match threads where at
least one message is tagged as "ignore" (the regexp must be more complex
to match only the tag part of the search output). Finally, I untag the
ignored threads so that they do not appear in inbox (the last command of
my tagging script is notmuch tag -new +inbox tag:new).

It would be easier to write such script if we have
notmuch search --output=thread-tags, which would print only tag part of
the standard notmuch search output.

-Michal

  reply	other threads:[~2010-11-24 21:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 15:47 hint: ignoring threads Sebastian Spaeth
2010-11-24 21:21 ` Michal Sojka [this message]
2010-11-24 22:02 ` Xavier Maillard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sjyqbepf.fsf@steelpick.2x.cz \
    --to=sojkam1@fel.cvut.cz \
    --cc=Sebastian@SSpaeth.de \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).