[Techtalk] directory-hook in mutt?

Conor Daly conor.daly at oceanfree.net
Thu Jun 19 00:27:38 EST 2003


On Wed, Jun 18, 2003 at 12:20:07PM -0700 or so it is rumoured hereabouts, 
Laurel Fan thought:
> So, what I want to do is:
> 
> I have several directories that contain mboxes (folders to mutt).
> When browsing these directories, I want to sort different directories
> different ways.  If there was such a thing as directory-hook, I would
> want to do something like:
> 
> directory-hook . set sort_browser=reverse-date
> directory-hook =archive set sort_browser=alpha
> 
> Unfortuantely, there does not seem to be such a thing as
> directory-hook.  Anyone know how I would do something like this?

folder-hook

 Usage: folder-hook [!]regexp command

  It is often desirable to change settings based on which mailbox you
  are reading.  The folder-hook command provides a method by which you
  can execute any configuration command.  pattern is a regular
  expression specifying in which mailboxes to execute command before
  loading.  If a mailbox matches multiple folder-hook's, they are
  executed in the order given in the muttrc.

  Note: if you use the ``!'' shortcut for ``$spoolfile'' at the
  beginning of the pattern, you must place it inside of double or single
  quotes in order to distinguish it from the logical not operator for
  the expression.

  Note that the settings are not restored when you leave the mailbox.
  For example, a command action to perform is to change the sorting
  method based upon the mailbox being read:

       folder-hook mutt set sort=threads

  However, the sorting method is not restored to its previous value when
  reading a different mailbox.  To specify a default command, use the
  pattern ``.'':

Conor
-- 
Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)
---------------------
Faenor.cod.ie
 12:29am  up 35 days,  2:57,  0 users,  load average: 0.00, 0.00, 0.13
Hobbiton.cod.ie
 12:27am  up 35 days,  2:55,  2 users,  load average: 0.06, 0.03, 0.01


More information about the Techtalk mailing list