On Sat, May 05, 2001 at 01:43:30AM +0100, mark wrote:
> On Thu, May 03, 2001 at 07:04:31PM -0500, Tim Legant wrote:
> > On Fri, May 04, 2001 at 12:14:36AM +0100, Mark Sheppard wrote:
> > > I normally save my mail in individual files depending on the user
> > > (set force_name=yes), but for mailing lists I would like to save
> > > them in a file for that particular mailing list. The kind of rule
> > > I thought of was like:
> > >
> > > save-hook ~l +$list
> >
> > In a message to this list a couple of weeks ago, Lars Hecking suggested:
> >
> > save-hook ~l =%0
> >
> > which must be some magic the developers know about... I'm assuming %0
> > represents the regex match, but I haven't found docs for this.
>
> Unfortunately [...] it doesn't work
It turns out that %B does what I was looking for. In the docs the %B
format string is only mentioned under "index_format", but it seems to
work for save-hook as well. However it looks like only some format
strings work in certain contexts. For example I thought that
"fcc-hook . =%b" might have done what the original poster to this
thread wanted (ie. save outgoing messages to the folder you're in at
the time), but it doesn't - %b is expanded as "(null)" although %v and
%s do work with fcc-hook.
Perhaps someone who's familiar with the internals of mutt could
clarify this? It'd be good if the documentation had a separate
section for format strings which explained under which context(s) each
can be used.
Mark.
PS. Thanks to Steven Isaacson for providing the %B answer. It
originally came from http://www.linuxbrit.co.uk/ which has some good
mutt configuration examples on it.