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

Re: mutt 1.4.2.1 not honoring folder-hooks with imap



On 2005-12-14, Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx> wrote:
> On Tuesday, December 13 at 09:54 PM, quoth Tyler Spivey:
> > Hello. I'm using mutt 1.4.2.1 (old, probably going to upgrade to 1.5.x 
> > soon) under Cygwin, Windows XP. I'm using Imap: and have the following 
> > folder hook:
> > folder-hook . set sort=threads
> > folder-hook "!" set sort=date
> > the inbox (!) hook seems to work, but I"m not sure. When I switch to 
> > naother mailbox, the hook to set sorting by threads doesn't seem to work.
> > Any help would be appreciated.
> 
> I'm not sure what you think this is supposed to achieve here.
> 
> The folder-hook syntax consists of three strings: "folder-hook" 
> "regexp-with-an-optional-exclamationpoint" and "command" -- you're 
> giving it four strings (granted, I don't know exactly when mutt decides 
> to read four or more strings and when it starts to get confused, I just 
> know that to be on the safe side you should put your command in quotes), 
> and the regexp in the second one doesn't make sense (it seems to say 
> "match anything that does not match the empty string").
> 
> I guess mutt is probably taking them to be essentially equivalent 
> regular expressions, since everything matches both any character (the 
> first one) and does not match the empty string (the second one). If 
> that's true, then it makes sense because folder-hooks are executed in 
> the order they appear in your muttrc -- so the second one supercedes the 
> first.
> 
> Try this:
> 
> folder-hook . "set sort=threads"
> folder-hook =$ "set sort=date"

The OP's second hook should work fine with the addition of quotes 
surrounding the command:

    folder-hook "!" "set sort=date"

In this context, '!' is a shortcut for '$spoolfile'.  See the manual 
section on the folder-hook.

Gary

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