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

Re: Fcc hook simplicity?



* Karl. <kmw1@xxxxxxxxxxx> [2006-06-12 08:53:22 +1200]:


> 
> Note that you need to use a hook when you are using '^', since ^ 
> references the current folder at the time of assignment.  ie. doing 
> this by itself:
> 
> set record="^"
> 
> won't generally do anything useful since the value of record is being 
> set to whatever the current folder is when that line is interpreted 
> (when muttrc is loaded, *not* what it is at the time when the copyself 
> mail is being saved.  If you put this in your muttrc (with nothing else 
> modifying record) then you'll get record set to nothing useful.  You 
> will not get the arguably desired effect of copyself emails being put in 
> whatever folder you are currently in.  To do that you need to use a 
> folder-hook - these are triggered when you *enter* folders (at which 
> time ^ has a meaningful value)
> 
> I use this:
> 
> set record                       ="+z_sent"      # default copyself folder 
> for batch mode
> folder-hook  .        'set record="+z_sent"'     # default copyself folder 
> for interactive mode
> folder-hook  +list-*  'set record="^"'           # use current-folder for 
> mailling-list copyselfs
> 
 
I'm now using something similar, but I force a reset thusly:

folder-hook .           source ~/.mutt/defaults.global
folder-hook +list-*     source ~/.mutt/defaults.maillist

in .mutt/folder-hooks (sourced by .muttrc)

defaults.maillist has something like:

source .mutt/defaults.global
set record ="^"

defaults.global has the line:

set record=~/Mail/Sent

Working so far...
-- 
Cheers,

  Dave