Discussion:
tell me how to do this (mass tagging of messages)
Jeff Templon
2018-10-17 08:06:18 UTC
Permalink
Hi,

So I do a search like this in notmuch emacs:

tag:spam

and what comes up is something like this ...

2013-07-27 [1/1] ASN Bank SURF***SPAM***6.8 ASN Bank: Belangrijke update mededeling (lists lists/grid spam)
2013-07-27 [1/1] Overdracht van geld SURF***SPAM***5.7 Uw account is geactiveerd. (spam)
2013-07-26 [1/1] Full Name SURF***SPAM***6.2 Need (spam)
2013-07-16 [1/14] Carlos Zorraquino... SURF***SPAM***6.2 Re: CHEP2013 Proceedings: invitation to submit a full paper for your contribution (spam)
2013-07-15 [1/1] Rabo Bank SURF***SPAM***5.8 2013 Rabo Bank Algemene voorwaarden en informatie (spam)

I take a look and decide I want to delete a bunch of messages, but take
a look at the fourth in the list - this is one where the SURF spam
filter has decided that one of the messages in the thread is spam, but
the entire thread has shown up here. If I take bulk action on such a
buffer, I've seen before that most commands work on the threads and not
the messages themselves, like the 'k' command.

So how do I make sure that I'm operating on the messages themselves
(only one of the 14 messages is marked 'spam') and not the threads?

Thanks. BTW I like notmuch pretty much.

JT

ps while I'm at it - inline display of attachments or in any case firing
up an external viewer? I only know about hitting return on the
attachment link and having it saved to a file.
Gregor Zattler
2018-10-17 09:48:33 UTC
Permalink
Hi Jeff,
Post by Jeff Templon
and what comes up is something like this ...
2013-07-27 [1/1] ASN Bank SURF***SPAM***6.8 ASN Bank: Belangrijke update mededeling (lists lists/grid spam)
2013-07-27 [1/1] Overdracht van geld SURF***SPAM***5.7 Uw account is geactiveerd. (spam)
2013-07-26 [1/1] Full Name SURF***SPAM***6.2 Need (spam)
2013-07-16 [1/14] Carlos Zorraquino... SURF***SPAM***6.2 Re: CHEP2013 Proceedings: invitation to submit a full paper for your contribution (spam)
2013-07-15 [1/1] Rabo Bank SURF***SPAM***5.8 2013 Rabo Bank Algemene voorwaarden en informatie (spam)
I take a look and decide I want to delete a bunch of messages, but take
a look at the fourth in the list - this is one where the SURF spam
filter has decided that one of the messages in the thread is spam, but
the entire thread has shown up here. If I take bulk action on such a
buffer, I've seen before that most commands work on the threads and not
the messages themselves, like the 'k' command.
So how do I make sure that I'm operating on the messages themselves
(only one of the 14 messages is marked 'spam') and not the threads?
AFAIK you navigate to this fourth line, hit ENTER, navigate to
the message tagged spam (probably it's the one unfolded) and use
"k" and presumably "D" (or however you configured
notmuch-tagging-keys) to mark this one as to be deleted.
Post by Jeff Templon
Thanks. BTW I like notmuch pretty much.
me too
Post by Jeff Templon
ps while I'm at it - inline display of attachments or in any case firing
up an external viewer? I only know about hitting return on the
attachment link and having it saved to a file.
With point on the attachment, hit ".v" in order to see the
attachment in your preferred application. Hit ".o" instead in
order to choose the right application from a list.

Ciao; Gregor
--
-... --- .-. . -.. ..--.. ...-.-
David Edmondson
2018-10-17 09:58:18 UTC
Permalink
Post by Jeff Templon
Hi,
tag:spam
and what comes up is something like this ...
2013-07-27 [1/1] ASN Bank SURF***SPAM***6.8 ASN Bank: Belangrijke update mededeling (lists lists/grid spam)
2013-07-27 [1/1] Overdracht van geld SURF***SPAM***5.7 Uw account is geactiveerd. (spam)
2013-07-26 [1/1] Full Name SURF***SPAM***6.2 Need (spam)
2013-07-16 [1/14] Carlos Zorraquino... SURF***SPAM***6.2 Re: CHEP2013 Proceedings: invitation to submit a full paper for your contribution (spam)
2013-07-15 [1/1] Rabo Bank SURF***SPAM***5.8 2013 Rabo Bank Algemene voorwaarden en informatie (spam)
I take a look and decide I want to delete a bunch of messages, but take
a look at the fourth in the list - this is one where the SURF spam
filter has decided that one of the messages in the thread is spam, but
the entire thread has shown up here. If I take bulk action on such a
buffer, I've seen before that most commands work on the threads and not
the messages themselves, like the 'k' command.
So how do I make sure that I'm operating on the messages themselves
(only one of the 14 messages is marked 'spam') and not the threads?
In this context, does it matter? If you remove 'spam' from the entire
thread it will affect only that one message, as it's the only one with
the tag.
Post by Jeff Templon
Thanks. BTW I like notmuch pretty much.
JT
ps while I'm at it - inline display of attachments or in any case firing
up an external viewer? I only know about hitting return on the
attachment link and having it saved to a file.
On the button for a part you can hit “. ?” to see the various
keybindings available there, including opening the part, saving to a
file, etc.

dme.
--
I'm in a backless dress on a pastel ward that's shining.
Jeff Templon
2018-10-17 11:39:10 UTC
Permalink
Hi,
Post by David Edmondson
Post by Jeff Templon
So how do I make sure that I'm operating on the messages themselves
(only one of the 14 messages is marked 'spam') and not the threads?
In this context, does it matter? If you remove 'spam' from the entire
thread it will affect only that one message, as it's the only one with
the tag.
Right. Poor example. I guess the better question is, in a screen full
of threads matching a particular query, how do I do a mass action on
only those messages that match the query and not on the threads?

I had the problem before when I was learning notmuch. I went to the
inbox, and saw a new message that was a contribution to a thread of
several messages (none of the other ones was tagged 'inbox'). The new
'inbox tagged' message of that thread was not important, so I did a 'k
d' on what I now know to be the thread, thinking it would only apply to
that one message that was actually in the inbox ...

I tried to find an option "turn off related messages in search results"
but could not find it.
Post by David Edmondson
On the button for a part you can hit “. ?” to see the various
keybindings available there, including opening the part, saving to a
file, etc.
Thanks to you and to Gregor for this.

JT
David Edmondson
2018-10-17 13:29:59 UTC
Permalink
Post by Jeff Templon
Hi,
Post by David Edmondson
Post by Jeff Templon
So how do I make sure that I'm operating on the messages themselves
(only one of the 14 messages is marked 'spam') and not the threads?
In this context, does it matter? If you remove 'spam' from the entire
thread it will affect only that one message, as it's the only one with
the tag.
Right. Poor example. I guess the better question is, in a screen full
of threads matching a particular query, how do I do a mass action on
only those messages that match the query and not on the threads?
There's no easy way to do that now.

Maybe we should make it such that a prefix argument to the tag operation
affects only matching messages in the affected threads?

dme.
--
You took the words right out of my mouth.
David Bremner
2018-10-17 13:39:59 UTC
Permalink
Post by David Edmondson
Post by Jeff Templon
Right. Poor example. I guess the better question is, in a screen full
of threads matching a particular query, how do I do a mass action on
only those messages that match the query and not on the threads?
There's no easy way to do that now.
Maybe we should make it such that a prefix argument to the tag operation
affects only matching messages in the affected threads?
A workaround could be to use "c q" to copy the query, then use that on
the command line with "notmuch tag".

d
Jeff Templon
2018-10-17 14:08:17 UTC
Permalink
Hi,
Post by David Bremner
Post by David Edmondson
Post by Jeff Templon
Right. Poor example. I guess the better question is, in a screen full
of threads matching a particular query, how do I do a mass action on
only those messages that match the query and not on the threads?
There's no easy way to do that now.
Maybe we should make it such that a prefix argument to the tag operation
affects only matching messages in the affected threads?
A workaround could be to use "c q" to copy the query, then use that on
the command line with "notmuch tag".
Indeed, as long as I am satisfied that all the messages in the view are
OK to delete / tag / whatever ... I usually look at such at view to make
sure that eg. the SPAM filter is doing the right thing.

My opinion : the best option would be to have some flag / toggle
variable / whatever that would cause a search results screen to display
only matching messages and not the whole thread.

J "am learning to be very careful when hitting keys" T
Carl Worth
2018-10-17 22:16:23 UTC
Permalink
Post by Jeff Templon
Indeed, as long as I am satisfied that all the messages in the view are
OK to delete / tag / whatever ... I usually look at such at view to make
sure that eg. the SPAM filter is doing the right thing.
I have not found any case in the notmuch-emacs UI where this has been an
issue for me, personally. If you do find a use case that's problematic,
let us know and we could certainly expand the interface to accommodate
that in some way.

Meanwhile, at the command line this distinction is made very clear. Try
each of these commands, for example:

notmuch search some-search-pattern

notmuch search --output threads some-search-pattern

notmuch search --output messages some-search-pattern

The second and third options there are very appropriate for generating a
list of threads (or messages) that you could then iterate over and
perform operations on.

And of course, if you're wanting to do an operation such as tagging or
un-tagging, then you can do that at that command-line directly without
needing an external loop over the results:

notmuch tag +some-tag some-search-pattern

notmuch tag -some-tag some-search-pattern

Both of these operations will act on matched messages, (no threads are
involved).

So hopefully playing with the above operations makes it clear how
notmuch itself is operating.

And the notmuch-emacs stuff is a pretty simple layer on top of that, so
again, we could easily improve things as necessary.
Post by Jeff Templon
My opinion : the best option would be to have some flag / toggle
variable / whatever that would cause a search results screen to display
only matching messages and not the whole thread.
That would certainly be an option.

But again, what operation does notmuch-emacs allow you to do on the
thread that you are really only wanting to do on the matching messages?

For me, a frequent operation is to just _see_ the matching messages. And
for this particular operation, just pressing "Enter" on a thread does
exactly that. It brings up a view of the whole thread, but with only the
matching messages open (and non-matching messages collapsed).

-Carl
Jeff Templon
2018-10-18 08:37:00 UTC
Permalink
Hi Carl,
Post by Carl Worth
Meanwhile, at the command line this distinction is made very clear. Try
notmuch search some-search-pattern
notmuch search --output threads some-search-pattern
notmuch search --output messages some-search-pattern
The second and third options there are very appropriate for generating a
list of threads (or messages) that you could then iterate over and
perform operations on.
And of course, if you're wanting to do an operation such as tagging or
un-tagging, then you can do that at that command-line directly without
notmuch tag +some-tag some-search-pattern
notmuch tag -some-tag some-search-pattern
Both of these operations will act on matched messages, (no threads are
involved).
So hopefully playing with the above operations makes it clear how
notmuch itself is operating.
Thanks for those examples, that does help.
Post by Carl Worth
But again, what operation does notmuch-emacs allow you to do on the
thread that you are really only wanting to do on the matching messages?
I wish I had made some screenshots of what happened last night - I can't
reproduce the steps involved, but what happened was that some message
got tagged in some unhelpful way (which is a solvable problem, that's
not the point) - the point was that I did some operation that was meant
to remove that "bad tag" and flag it as "inbox" to deal with later, and
what happened was that all the messages in the whole thread (all 45 of
them) got tagged as inbox, which was not the intent.

I guess the point for me is that I frequently search for messages (and
not threads), and when I do so, it's easy for me to forget that actions
taken on the results buffer not only apply to those messages, they can
apply to all messages in threads that happen to contain a matched
message.

I'll try to capture any examples in the future!

JT
Keith Amidon
2018-12-01 16:19:56 UTC
Permalink
Post by Jeff Templon
I guess the point for me is that I frequently search for messages (and
not threads), and when I do so, it's easy for me to forget that actions
taken on the results buffer not only apply to those messages, they can
apply to all messages in threads that happen to contain a matched
message.
I'm very late to this thread, and ironically not using notmuch to send
this reply, but I have an additional suggestions to support this use
case that may still be useful to Jeff or anyone who might find this
thread through a search of the list archive.

I too frequently search for specific messages, but I use the package
counsel-notmuch[1] (which was inspired by helm-notmuch[2]) for this
task. This is relevant to this thread because these packages present a
view of matching *messages* that updates as you type your query. When
you select one of the message they take you directly to the selected
message in notmuch-show-mode instead of the list of threads with
matching messages in notmuch-search-mode that a regular notmuch search
does (which is also very useful, but is the less common workflow for
me). Tagging actions, etc. are then naturally applied to the specific
message, though I will say that since search works so well this way, I
use tags fairly infrequently.

Neither project page for these packages makes any attempt to convey how
awesome it feels to have a filter-as-you-type experience for plucking
exactly the message from 2 years ago that you're looking for from your
mail archive with a few seconds of typing, or the looks of incredulity
you receive from anyone who sees you do it.

And of course, it's all notmuch under the hood making this happen.
Notmuch is just *awesome*. :-)

--- Keith

[1] https://github.com/fuxialexander/counsel-notmuch
[2] https://github.com/xuchunyang/helm-notmuch

Loading...