Mutt config question
Edward Glowacki
glowack2@msu.edu
Fri, 3 Aug 2001 09:18:10 -0400
Quoted from Dennis Kelly on Thu, Aug 02, 2001 at 04:48:20PM -0400:
> On Tue, Jul 31, 2001 at 01:24:50PM -0400, Edward Glowacki wrote:
>
> OK, here's a MUTT configuration question. I've RTFM'd and can't
> figure it out:
>
> How do you set the FCC to the current folder? For example, if I'm
> in the LUG list folder and send a message, it should save a copy in
> the LUG list folder. I know you can set fcc for each folder
> manually, but what I'd like is to do it automatically, so that if I
> create a new folder and try to send messages while in that folder,
> I don't have to edit my muttrc file first and put in an FCC hook to
> do it.
>
> There's a shortcut for "the file you've last visited", but that one
> is always a step behind where I'm at... ;)
>
> >From web searches and my own readings, it isn't currently possible to
> FCC the current folder. What you need to do is hack the mutt source
> and enable the %B expansion in the 'fcc-hook' :)
>
> dpk
Mwhahahah! Someone else has already done the dirty work! =) The
thread where I found the info is at:
http://www.mail-archive.com/mutt-users%40mutt.org/msg11750.html
and the important part of the patch is:
--- mutt-1.2.1-org/muttlib.c Tue Jun 20 16:22:05 2000
+++ mutt-1.2.1/muttlib.c Wed Jun 21 10:04:06 2000
@@ -429,7 +429,18 @@ char *_mutt_expand_path (char *s, size_t
tail = s + 1;
}
break;
-
+
+ case '^':
+ {
+ if (Context)
+ {
+ strfcpy (p, Context->path, sizeof (p));
+ tail = s + 1;
+ break;
+ }
+ }
+ /* Fall through */
+
default:
{
*p = '\0';
(there's also a patch for the documentation to explain it)
So simple, it's a wonder they haven't incorporated it into the main
source tree yet (it's not in the latest development version, I
checked...), considering I've seen several different questions
about doing this already. And yes, the patch works with 1.2.5,
though I applied it by hand because the patch was designed for
1.2.1. To use it, I just added "fcc-hook . ^" to my .muttrc.
--
Edward Glowacki glowack2@msu.edu
GLLUG Peon http://www.gllug.org
Imagination is the one weapon in the war against reality.
-- Jules de Gaultier