sean finney on 20 Jan 2005 21:37:16 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] mutt close-hook advice


On Thu, Jan 20, 2005 at 04:19:35PM -0500, Flint Heart wrote:
> The only problem with this is that its only changed every time you start up
> mutt. ( unless I'm missing a config option someplace ) So I just restart
> mutt at the begining of a month...

i have something i use to get around this problem.  using folder/message
hooks, you can re-evaluate your muttrc every time you change mail
folders or messages.  for example, i have a few different
"personalities" with different mutt settings.  in my muttrc i do
something like:

# re-evaluate default settings every new message or change in mailbox
folder-hook . "source ~/.mutt/muttrc.common"
message-hook . "source ~/.mutt/muttrc.common"

where muttrc.common is where all the main settings are.  then, later,
i have a few stanzas that look something like:

# settings specific for debian-related stuff
folder-hook +debian "source ~/.mutt/muttrc.debian"
message-hook "~t .*@.*debian.org" "source ~/.mutt/muttrc.debian"

if the message is to a debian address, or in my debian mailbox,
it sources my debian muttrc (which sets my address/sig/etc).  if
i change back to my inbox, it sources the common muttrc again,
reseting my settings to their default.

i imagine you could do something similar:

cat << EOF > .mutt/muttrc.mailrotate
mbox-hook +ML.plug "+lists/ML.plug-`date +%Y-%m`"
mbox-hook +ML.foo "+lists/ML.foo-`date +%Y-%m`"
EOF

and then in your muttrc:

folder-hook . "source ~/.mutt/muttrc.mailrotate"

though i think it might be a bit excessive to do this on a message
by message basis.  you could also re-source the mailrotate muttrc
file if you haven't changed your mailbox in over a month :)


	sean

Attachment: signature.asc
Description: Digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug