Re: Abort macro if limit pattern does not match anything

2022-12-01 Thread Dave Ewart
On Thursday, 01.12.2022 at 07:41 +1100, Cameron Simpson wrote:

> On 30Nov2022 08:13, Kai Weber  wrote:
> > * Max G�rner :
> > 
> > > Is there a way to abort the macro if the pattern does not match anything? 
> > > It
> > > is quite annoying to tidy up after the macro every now and then.
> > 
> > Have a look at 
> 
> As an example, my folder hooks have this:
> 
> folder-hook . 'push 
> "~P~NN~T"'
> 
> which marks all "NEW" messages from me as not new.

This approach also helpfully puts the message "Nothing to do" in the status
message, which is very handy.

Cheers,

Dave.

-- 
Dave Ewart, da...@sungate.co.uk



signature.asc
Description: PGP signature


Re: Abort macro if limit pattern does not match anything

2022-11-30 Thread Cameron Simpson

On 30Nov2022 08:13, Kai Weber  wrote:

* Max G�rner :


Is there a way to abort the macro if the pattern does not match anything? It
is quite annoying to tidy up after the macro every now and then.


Have a look at 


As an example, my folder hooks have this:

folder-hook . 'push 
"~P~NN~T"'

which marks all "NEW" messages from me as not new.

Cheers,
Cameron Simpson 


Re: Abort macro if limit pattern does not match anything

2022-11-29 Thread Kai Weber
* Max Görner :

> Is there a way to abort the macro if the pattern does not match anything? It
> is quite annoying to tidy up after the macro every now and then.

Have a look at 


Re: Abort macro if limit pattern does not match anything

2022-11-29 Thread Kevin J. McCarthy

On Tue, Nov 29, 2022 at 08:25:02PM +0100, Max Görner wrote:
Is there a way to abort the macro if the pattern does not match 
anything? It is quite annoying to tidy up after the macro every now and 
then.


Hi Max,

Have you tried using  instead of ";" in your macro? 
See  for more details.


--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


Abort macro if limit pattern does not match anything

2022-11-29 Thread Max Görner

Hello,

I wrote a macro to move certain e-mails into a corresponding folder. For this,
I first tag all matching messages using a limit and then try to move them to a
different folder. The relevant snippets from my .muttrc are:

macro index M "?" "move a message to a 
mailbox"
macro index ${my_Leader}cc 'T~N !~p !~P !~smandatory;M/Carbon 
Copies' "Move to Carbon Copies"

Now, more often than not the limit pattern does not match any message. Thus,
no message gets tagged. Subsequently the macro moves the message that is
currently selected.

Is there a way to abort the macro if the pattern does not match anything? It
is quite annoying to tidy up after the macro every now and then.

Thank you very much.


Best Regards
Max Görner