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

Re: Automatically fill TO: based on folder



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday, August 27 at 10:36 AM, quoth felix@xxxxxxxxxxx:
> Speaking of similar things, I see a lot of macros on this list, and 
> I have not used them yet.  I wanted to set Fcc: to the folder I am 
> mailing from, and tried doing this for each folder:
>
>    folder-hook mutt "set record=~/Maildirs/mutt/"
>
> It did nothing that I could see and I had forgotten all about it until 
> I saw this thread.  Are these the kinds of things better solved by 
> macros, or does your To: example require a macro because mutt has no 
> specific function like it does for "record"?

Mutt is, in many ways, like perl: there's more than one way to do it! 
Macros and hooks are both quite powerful, and their capabilities 
overlap in many ways.

For setting the FCC, for example, you *can* set $record, but you could 
also use an fcc-hook.

An easy way to set the FCC to whatever the current folder is would be:

     folder-hook . 'set record=^'

The equivalent fcc-hook:

     fcc-hook . ^

...won't work because the ^ is interpreted at the time the hook is 
established, whereas in the case of the folder-hook, it's 
re-interpreted every time the hook triggers.

The nice thing about using $record (or an fcc-hook) rather than a 
macro is that it works no matter how you've initiated your email 
whether by starting a new email, replying to a previous one, using a 
list-reply command, or what-have-you. The downside (or the upside, 
depending on how you look at it) to macros is that they only are 
triggered by specific keypresses. So you could create an extremely 
elaborate set of behaviors using macros that would be impossible with 
hooks, but it would be a lot of work.

~Kyle
- -- 
Hanging on to resentment is letting someone you despise live rent-free 
in your head.
                                                         -- Ann Landers
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iEYEARECAAYFAki1lbMACgkQBkIOoMqOI16jAQCffmehA47k5A4dtpXwvfrqgVyG
L48AniNPwtgD5hf4hUgrsKhPK3i2nJoY
=T0jU
-----END PGP SIGNATURE-----