Re: Automatically fill TO: based on folder
- To: mutt-users@xxxxxxxx
- Subject: Re: Automatically fill TO: based on folder
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Wed, 27 Aug 2008 12:58:11 -0500
- Comment: DomainKeys? See http://domainkeys.sourceforge.net/
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=memoryhole.net; h=date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=hV/5dCtfIy9ZDTHheHw3ef68d5c=; b=MkS5 aMT+rd/aGluvfqsztu18GnwzNPa0aJjRKQ/FsH1arIAibZ2EipbQeR0QVPc4wM2t zXnAdEm1AEdN7AYjrSaVXjeFhjyGocc/8PHePCguMizDTH6za5umxPrX9OW0qOcb 7I6C12GfzAu0SFK8h9U0YLnBfxIV3Qq084cscn4=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=HiCJKs6mtK/pHcFdfZQEfG9IgOFfIN5hbbVdwcfJx94pWl+0pkX/JoFuru9ZkJjgm7MsjV3VdOSek1f9ns5UPgI3ReiExTPK1j9JBbSl0e3IUsZQfkJYcWzdzdyO3qjKHZfiO6EFsf1c+WrZFrX2hHb/86YPxKTieVOoQTF1WdU=; h=Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:OpenPGP:User-Agent;
- In-reply-to: <20080827173653.GA16986@xxxxxxxxxxx>
- List-post: <mailto:mutt-users@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-users"
- Mail-followup-to: mutt-users@xxxxxxxx
- Openpgp: id=CA8E235E; url=http://www.memoryhole.net/~kyle/kyle-pgp.asc; preference=signencrypt
- References: <20080827123624.GA7931@localdomain> <20080827161143.GA10765@xxxxxxxxxxxxxxxxxxxxxxxx> <20080827173653.GA16986@xxxxxxxxxxx>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.18 (2008-08-25)
-----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-----