On Wed May03'23 09:59:17AM, Will Yardley wrote:
> From: Will Yardley <mutt-us...@veggiechinese.net>
> Date: Wed, 3 May 2023 09:59:17 -0700
> To: mutt-users@mutt.org
> Subject: Re: restrict folder hook to specific folder(s)
>
> On Wed, May 03, 2023 at 11:27:05AM -0500, Ranjan Maitra wrote:
>
> > I have a folder called "R". There are other folders that have "R" in
> > their name. However, when I set up a
> >
> > folder-hook '(R)'
> >
> > it seems to apply to all folders with R in it, with embarrassing
> > consequences. How do I make sure that the hook applies to the R folder
> > and nothing else?
>
> I've not used folder-hooks myself, but it looks like you may have to
> anchor one or both sides of the regex to get the behavior you want.
>
> http://www.mutt.org/doc/manual/#mailbox-hook
>
> has some examples.
>
> and
> http://www.mutt.org/doc/manual/#regexp
> has some info on the regex syntax
>

Thanks for this! I am a little lost on how to use these syntax for my specific 
use case. I was looking for a way to have mailhooks only apply to specific 
named folders.

I tried giving the complete pathname:

/home/user/Mail/R

but this is cumbersome to put for all the folders, one by one, and also this 
does not specifically exclude out folders such as /home/user/Mail/Rsomething

Is there a way to have a specific hook for only a specific folder?

Many thanks and best wishes,
Ranjan



Reply via email to