unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* tell me how to do this (mass tagging of messages)
@ 2018-10-17  8:06 Jeff Templon
  2018-10-17  9:48 ` Gregor Zattler
  2018-10-17  9:58 ` David Edmondson
  0 siblings, 2 replies; 10+ messages in thread
From: Jeff Templon @ 2018-10-17  8:06 UTC (permalink / raw)
  To: notmuch

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.

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

* Re: tell me how to do this (mass tagging of messages)
  2018-10-17  8:06 tell me how to do this (mass tagging of messages) Jeff Templon
@ 2018-10-17  9:48 ` Gregor Zattler
  2018-10-17  9:58 ` David Edmondson
  1 sibling, 0 replies; 10+ messages in thread
From: Gregor Zattler @ 2018-10-17  9:48 UTC (permalink / raw)
  To: notmuch

Hi Jeff,
* Jeff Templon <templon@nikhef.nl> [2018-10-17; 10:06]:
> 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.

> Thanks.  BTW I like notmuch pretty much.

me too

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

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

* Re: tell me how to do this (mass tagging of messages)
  2018-10-17  8:06 tell me how to do this (mass tagging of messages) Jeff Templon
  2018-10-17  9:48 ` Gregor Zattler
@ 2018-10-17  9:58 ` David Edmondson
  2018-10-17 11:39   ` Jeff Templon
  1 sibling, 1 reply; 10+ messages in thread
From: David Edmondson @ 2018-10-17  9:58 UTC (permalink / raw)
  To: Jeff Templon, notmuch

On Wednesday, 2018-10-17 at 10:06:18 +02, Jeff Templon wrote:

> 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?

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.

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

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

* Re: tell me how to do this (mass tagging of messages)
  2018-10-17  9:58 ` David Edmondson
@ 2018-10-17 11:39   ` Jeff Templon
  2018-10-17 13:29     ` David Edmondson
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Templon @ 2018-10-17 11:39 UTC (permalink / raw)
  To: David Edmondson, notmuch

Hi,

David Edmondson <dme@dme.org> writes:

> On Wednesday, 2018-10-17 at 10:06:18 +02, Jeff Templon wrote:

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

> 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

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

* Re: tell me how to do this (mass tagging of messages)
  2018-10-17 11:39   ` Jeff Templon
@ 2018-10-17 13:29     ` David Edmondson
  2018-10-17 13:39       ` David Bremner
  0 siblings, 1 reply; 10+ messages in thread
From: David Edmondson @ 2018-10-17 13:29 UTC (permalink / raw)
  To: Jeff Templon, notmuch

On Wednesday, 2018-10-17 at 13:39:10 +02, Jeff Templon wrote:

> Hi,
>
> David Edmondson <dme@dme.org> writes:
>
>> On Wednesday, 2018-10-17 at 10:06:18 +02, Jeff Templon wrote:
>
>>> 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.

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

* Re: tell me how to do this (mass tagging of messages)
  2018-10-17 13:29     ` David Edmondson
@ 2018-10-17 13:39       ` David Bremner
  2018-10-17 14:08         ` Jeff Templon
  0 siblings, 1 reply; 10+ messages in thread
From: David Bremner @ 2018-10-17 13:39 UTC (permalink / raw)
  To: David Edmondson, Jeff Templon, notmuch

David Edmondson <dme@dme.org> writes:

> On Wednesday, 2018-10-17 at 13:39:10 +02, Jeff Templon wrote:

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

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

* Re: tell me how to do this (mass tagging of messages)
  2018-10-17 13:39       ` David Bremner
@ 2018-10-17 14:08         ` Jeff Templon
  2018-10-17 22:16           ` Carl Worth
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Templon @ 2018-10-17 14:08 UTC (permalink / raw)
  To: David Bremner, David Edmondson, notmuch

Hi,

David Bremner <david@tethera.net> writes:

> David Edmondson <dme@dme.org> writes:
>
>> On Wednesday, 2018-10-17 at 13:39:10 +02, Jeff Templon wrote:
>
>>> 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

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

* Re: tell me how to do this (mass tagging of messages)
  2018-10-17 14:08         ` Jeff Templon
@ 2018-10-17 22:16           ` Carl Worth
  2018-10-18  8:37             ` Jeff Templon
  0 siblings, 1 reply; 10+ messages in thread
From: Carl Worth @ 2018-10-17 22:16 UTC (permalink / raw)
  To: Jeff Templon, David Bremner, David Edmondson, notmuch

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

On Wed, Oct 17 2018, Jeff Templon wrote:
> 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.

> 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



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: tell me how to do this (mass tagging of messages)
  2018-10-17 22:16           ` Carl Worth
@ 2018-10-18  8:37             ` Jeff Templon
  2018-12-01 16:19               ` Keith Amidon
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Templon @ 2018-10-18  8:37 UTC (permalink / raw)
  To: Carl Worth, David Bremner, David Edmondson, notmuch

Hi Carl,

Carl Worth <cworth@cworth.org> writes:

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

Thanks for those examples, that does help.

> 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

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

* Re: tell me how to do this (mass tagging of messages)
  2018-10-18  8:37             ` Jeff Templon
@ 2018-12-01 16:19               ` Keith Amidon
  0 siblings, 0 replies; 10+ messages in thread
From: Keith Amidon @ 2018-12-01 16:19 UTC (permalink / raw)
  To: notmuch

On 10/18/18 1:37 AM, Jeff Templon wrote:
> 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

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

end of thread, other threads:[~2018-12-01 16:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17  8:06 tell me how to do this (mass tagging of messages) Jeff Templon
2018-10-17  9:48 ` Gregor Zattler
2018-10-17  9:58 ` David Edmondson
2018-10-17 11:39   ` Jeff Templon
2018-10-17 13:29     ` David Edmondson
2018-10-17 13:39       ` David Bremner
2018-10-17 14:08         ` Jeff Templon
2018-10-17 22:16           ` Carl Worth
2018-10-18  8:37             ` Jeff Templon
2018-12-01 16:19               ` Keith Amidon

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