unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* hint: ignoring threads
@ 2010-11-23 15:47 Sebastian Spaeth
  2010-11-24 21:21 ` Michal Sojka
  2010-11-24 22:02 ` Xavier Maillard
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Spaeth @ 2010-11-23 15:47 UTC (permalink / raw)
  To: Notmuch developer list

[-- Attachment #1: Type: text/plain, Size: 813 bytes --]

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`

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.

Sebastian

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: hint: ignoring threads
  2010-11-23 15:47 hint: ignoring threads Sebastian Spaeth
@ 2010-11-24 21:21 ` Michal Sojka
  2010-11-24 22:02 ` Xavier Maillard
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Sojka @ 2010-11-24 21:21 UTC (permalink / raw)
  To: Sebastian Spaeth, Notmuch developer list

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: hint: ignoring threads
  2010-11-23 15:47 hint: ignoring threads Sebastian Spaeth
  2010-11-24 21:21 ` Michal Sojka
@ 2010-11-24 22:02 ` Xavier Maillard
  1 sibling, 0 replies; 3+ messages in thread
From: Xavier Maillard @ 2010-11-24 22:02 UTC (permalink / raw)
  To: Sebastian Spaeth, Notmuch developer list

Hi,

On Tue, 23 Nov 2010 16:47:13 +0100, Sebastian Spaeth <Sebastian@SSpaeth.de> wrote:
> I like to ignore annoying threads, but notmuch has not easy way to
> achieve it, right? Well, it actually has...

If it has, it is only ugly hack in my point of view. What is missing the
most currently is scoring rules ala GNUS (formerly adaptative scoring).
 
> 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`

Pretty cool !

Cheers

/Xavier

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-24 21:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-23 15:47 hint: ignoring threads Sebastian Spaeth
2010-11-24 21:21 ` Michal Sojka
2010-11-24 22:02 ` Xavier Maillard

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).