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

Re: 'folder-hook . set sort=threads' and 'set sort=threads'



* On Tue, Apr 21, 2009 11:05PM -0500 Zhengquan Zhang 
(zhang.zhengquan@xxxxxxxxx) muttered:
> folder-hook .  set sort=threads
> 
> set sort=threads 
> 
> Basically they do the same thing. Is there anything I am missing here?

Yes, they do the same thing - unless sort is changed by another
folder-hook for some folders.
What you quote is what we call a default hook. It provides the generic 
default case and is overwritten by the special case.

For example:
folder-hook .      set sort=threads
folder-hook +spam 'set sort=spam'

When you enter the spam folder the sorting is changed to the spam
rating. Now when you change to another folder you need a mechanism to
change it back. Thus the default hook.

Provided you had only:
set sort=threads
folder-hook +spam 'set sort=spam'

Once mutt parses the rc file you would have sort=threads. But if you
changed to the spam folder it would be sort=spam as intended. Only how
do you get it back now? You don't - you need the default hook. As it is
the case with all -hooks btw.

HTH,

Michael
-- 
"It's God.  No, not Richard Stallman, or Linus Torvalds, but God."
(By Matt Welsh)

PGP-Key-ID: 0xDC1A44DD
Jabber:     init[0]@amessage.de