<<< Date Index >>>     <<< Thread Index >>>

Re: my_hdr + Folder-hook



On 2006-02-24, Dave Waxman <dave@xxxxxxxxxx> wrote:
> I am having an issue with my mutt install using an organization 
> header that should only be used for a specific folder-hook.  I 
> have a default my_hdr Organization: set ABOVE the folder hooks and 
> then I have a specific one IN the folder-hooks.  When I am not in 
> the specific folder, shouldn't it use the default my_hdr?

Mutt's hooks are triggered by events, not enabled by states.  A 
folder-hook is triggered when you enter the specified folder and the 
results of its associated command remain in effect until changed by 
some other command.

So for example,

    set sort=date-received
    folder-hook +Lists/. set sort=threads

will initially set sort to "date-received" and will change it to 
"threads" when any folder under +Lists/ is entered, but it will 
remain set to "threads" thereafter no matter what folder you enter.  
To make the default setting be "date-received" for any folder other 
than those under +/Lists, you need to provide a default folder-hook, 
like this:

    folder-hook .        set sort=date-received
    folder-hook +Lists/. set sort=threads

I did not use my_hdr in these examples because, as I recall, that 
command has considerations that I didn't want to think about for 
this reply and I didn't want to mislead you by providing a my_hdr 
example that doesn't work.

HTH,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA