pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
695 stars 164 forks source link

untag --all applies to messages in search buffer #1498

Open kirelagin opened 4 years ago

kirelagin commented 4 years ago

I am not sure about this one, maybe its just me. The semantics of untag --all in a search buffer is to apply to all matching messages. However I subconsciously expect it to apply to threads that I currently see on the screen. I guess it might be useful to have an option for this.

Describe the solution you'd like

Change the behaviour of untag --all (and similar commands) to apply to apply to all messages in all threads in which at least one message matches the query.

I.e. search tag:inbox; untag --all foo should be equivalent to notmuch tag -foo 'thread:{tag:inbox}' rather than not much tag -foo 'tag:inbox'. But since the query can be more complex, it might not be possible to put it inside thread:{}, so that will likely need to be an external loop.

Describe alternatives you've considered

Additional context

I think it’s just more natural for the command to apply to objects I currently see on the screen, rather than something implied by what I see. Also it will be more consistent with untag --all in a thread buffer, where it applies to all messages I see regardless of how exactly I found this thread originally.

pazz commented 4 years ago

I agree with this. In fact the notmuch query syntax thread:{tag:inbox} is new to me and it certaily wasn't available when I wrote this code (I remember that everything in notmuch was message based, and lots of people kept complaining about the resulting unintuitive behaviour of alot, which I could not do anything about). If it is now part of libnotmuch, and propagated to the python bindings, then it should be cheap to implement what you suggest. A PR would be much appreciated.

mjg commented 4 years ago

I agree that this is more natural,but how do you get the current behaviour when you need it? For that we would need a search buffer which displays matching messages only. Then the same untag --all in these two different search buffers would give bothe behaviours in a completely natural way.

guludo commented 8 months ago

Maybe the requested behavior should be implemented with a different option, like --all-threads?