Re: Inline text attachments
- To: mutt-users@xxxxxxxx
- Subject: Re: Inline text attachments
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Tue, 14 Jul 2009 14:35:50 -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=T9HabrayupqVv93zepRG812SiX0=; b=aGa0 bMD/+sG+iAGOzWAM1qtjUAzjLqIPz8KOtt+1Ur0MreoiVTVOTSMk+a83cTWWsw/J 07nKEvdpY0jYsyIdjAODZVzJItrplUhgfWXhlMUkUTPXQ/SaldRfP3/Kmg5h43+t /m55UXngNuVSXukt7fTj7xaJ7E0DIuEUKNJiNis=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=HxloJ35aTOLEGL6cuQFPjh+6EMG8Kp/SNX+h6d7WXUECRjn/fU0pvX20+PVvwTwqfX3cc/0nyHbE94HJJ1M8OIdSXkWJneqgSkAVWeC1w76dmkXpX2eAFrYnBfArsv0xAAtT5EN6tEzxqutLXgBkY/K2V9TLjJHmBql3ZJA7vfo=; 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: <20090714181217.GA7867@xxxxxxxxxxxx>
- 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: <20090714181217.GA7867@xxxxxxxxxxxx>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.20 (2009-07-07)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Tuesday, July 14 at 07:12 PM, quoth Noah Slater:
>I would like to add new inline text attachments with ease.
Hm. Let's get back to that in a minute.
>At the moment, I am doing:
>
> n<enter>foo.txt<enter>text/plain
>
>This brings up vi to edit my text file.
This uses your mailcap to decide what to use to compose a text/plain
file. Chances are this is being defined in a global mailcap file (e.g.
/etc/mailcap), and looks something like this:
text/plain: less ; compose=vi
On my system, I don't have such a line, so mutt just complains that it
cannot find an application to compose a text/plain.
The issue here is that mutt is set up to handle creating a file of
*ANY* MIME-type, and does not have a special-case to handle text/plain
so that it "just knows" to use $EDITOR (or even $editor). That's why
mutt relies on the mailcap file to figure out what program to run.
When you think about it, this makes sense from a "create any arbitrary
MIME-type" point of view; not from a "add another text component to my
message" point of view.
>Once this has been edited, I do:
>
> ^d
For reference, since people can and do rebind their keys, it's
probably better to refer to things by their function names. In this
case (as you can see from the help menu), it's <toggle-disposition>.
>This seems to work, but I have a few questions:
>
> * Can I automate this whole process so that I can press a single button, and
> it will create a new file similar to how it does for a regular message. I
> don't want to have to think about naming this file, or typing it's mime
> type
> out each time. I would also like it to be set to inline.
You *can* automate the process, but creating a random file name is
going to be difficult. Mutt isn't set up to do that. Most folks don't
want multiple inline text parts (most of us just create a single text
part).
However, automating the process is possible, just not very easy. You
can use an external script that uses mktemp to create a temporary text
file, call emacs on that file, and create a temporary configfile that
mutt can source that contains all the commands to make mutt add that
new temporary text file to the current message. (Hey, you're doing
something a bit weird, so the solution is a bit weird. Them's the
breaks.)
> * Why does it launch vi, when my EDITOR is set up correctly? Editing the
> message correctly launches emacs. I see from the help that this may be
> using
> mailcap, but am confused what I need to change.
You can add a line to your mailcap to handle text/plain messages that
contains a "compose=" setting, like this:
text/plain; less; compose=emacs %s
For a detailed explanation of that, read the mailcap man page.
But if you take my advise about the external script, then modifying
your mailcap won't be necessary.
~Kyle
- --
The future is here. It's just not widely distributed yet.
-- William Gibson
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iQIcBAEBCAAGBQJKXN4WAAoJECuveozR/AWe7m8P/2HKVPykRmVpr9EPYZuXbB0z
CZL4Z1pYnjtdr0WnirBuD0UYy2FNzrTeCxkluvtw0WNo4OX2oLFUzvUbwHry0fi+
tmvGQALb85vETXjHdZ6TMu6cPujyK3b2fshTAFgOFjLjEEb8ZHWdokhDJ8kqLpvj
0R8R2ZTx7+WLwVFlkMr13qaEJkD5ame8AGs4gphz45ojSqytKB8EwSWjZeFFJ8MM
fq3ymAV7sXGv9gWFtuU1sBdw/WvlA+0cHgwafqgFhX4PIcT3R22H4o+U9V2RebV4
tBIpsfEXvD3u1wdKW7F48J1abSXsJLiRb9IpwcBYqZZGzxKP08FB9OLQqox2sn6l
f5Y5cY0NVQ4vx8CoZPfUZXflUmr7x6FMrYs1doXhdh8N4CRYiioyGUDgwKe3/klw
XSqo9HaEDjZWXz/iwF2JNjpibOf7DFfmQr+IWZlD8vrdMctW2Gv55cyJyPLjEAk2
UstA1gvMPMYnWa7Ge5/ORRFNh094OTpAro+SCw8p/PfmhnPM6EnXQIFU4zFJcn5h
9e5z12HYHukbzhAgU4JTOYgDvKZIWH31K5WwrBYLCiotL6bJ6dfUtrvQfyARgxlj
/7mBeI7Y9ccbFtZU8ivbczIFtGOeMBcH21O/l8/lrfmqhl1pylvOIGlG/SYhr/gh
uFyZU0qb90TOAeNe1CKC
=yCVa
-----END PGP SIGNATURE-----