[Solved, Thanks!] Re: 'folder-hook . set sort=threads' and 'set sort=threads'

2009-04-22 Thread Zhengquan Zhang
On Tue, Apr 21, 2009 at 11:17:57PM -0500, Kyle Wheeler wrote:
> That hook, in essence, resets the sort order when you change folders. 
> So if you temporarily change your sort to "reverse-date" and then open 
> a new folder, the sort order will be set back to threads rather than 
> staying "reverse-date".

Thanks Kyle for your pitty explanation!

Regards,

-- 
Zhengquan



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

2009-04-22 Thread Zhengquan Zhang
On Wed, Apr 22, 2009 at 06:36:36AM +0200, Michael Tatge wrote:
> 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.

This cleared up my confusion so nicely. Thanks Michael!

-- 
Zhengquan



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

2009-04-21 Thread Michael Tatge
* On Tue, Apr 21, 2009 11:05PM -0500 Zhengquan Zhang 
(zhang.zhengq...@gmail.com) 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...@amessage.de


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

2009-04-21 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tuesday, April 21 at 11:05 PM, quoth Zhengquan Zhang:
>This has puzzling me for quite a while,
>I saw in several muttrcs 
>
>they use 
>
>folder-hook .  set sort=threads
>
>but I don't understand why they don't use
>
>set sort=threads 
>
>instead.
>
>Basically they do the same thing. Is there anything I am missing here?

You're assuming that you would never change the sort order manually.

That hook, in essence, resets the sort order when you change folders. 
So if you temporarily change your sort to "reverse-date" and then open 
a new folder, the sort order will be set back to threads rather than 
staying "reverse-date".

~Kyle
- -- 
No one really listens to anyone else, and if you try it for a while 
you'll see why.
   -- Mignon McLaughlin
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iEYEARECAAYFAknumnUACgkQBkIOoMqOI146awCfWrdrYPK1zlL3Nlx9tZG/UiUn
hGEAoIlUm79ciGHFRx7sf/1pZupWGE7c
=44t8
-END PGP SIGNATURE-


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

2009-04-21 Thread Zhengquan Zhang
Dear mutt community:

This has puzzling me for quite a while,
I saw in several muttrcs 

they use 

folder-hook .  set sort=threads

but I don't understand why they don't use

set sort=threads 

instead.

Basically they do the same thing. Is there anything I am missing here?

Thanks and Regards,

-- 
Zhengquan