emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending attachments


From: Reiner Steib
Subject: Re: Sending attachments
Date: Wed, 08 Jul 2009 21:08:01 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux)

On Wed, Jul 08 2009, Richard Stallman wrote:

>     As does MML (mml-attach-file).
>
> It isn't in the emacs-mime manual so I did not know about it.  

It is documented in the Message manual:

,----[ (info "(message)MIME") ]
|    The most typical thing users want to use the multipart things in
| MIME for is to add "attachments" to mail they send out.  This can be
| done with the `C-c C-a' command (`M-x mml-attach-file'), which will
| prompt for a file name and a MIME type.
| 
|    If your Emacs supports drag and drop, you can also drop the file in
| the Message buffer.  [...]
`----

> I tried it just now.  It asked me a lot of questions and then
> inserted this text.
>
> <#part type="text/x-sh" filename="~/foo.sh" disposition=inline 
> description=foo>
> <#/part>
>
> I suppose this is MML and needs to get converted later.
> However, when I sent the message with C-c C-c, it did not convert.
> I don't see that it set up any hook to do so.

message-mode does the conversion automatically

,----[ (info "(message)MIME") ]
| Message is a MIME-compliant posting agent.  The user generally doesn't
| have to do anything to make the MIME happen--Message will automatically
| add the `Content-Type' and `Content-Transfer-Encoding' headers.
`----

> After a lot of searching thru that manual I found the function
> mml-to-mime.

Well, it under Composing -> Conversion, which seem quite suitable to
me.  

,----[ (info "(emacs-mime)Conversion") ]
|    An MML message can be converted back to MIME by the `mml-to-mime'
| function.
`----

message-mode uses mml-generate-mime, though:

,----[ (info "(emacs-mime)Composing") ]
|    The main interface function is `mml-generate-mime'.  It will examine
| the contents of the current (narrowed-to) buffer and return a string
| containing the MIME message.
`----

> If mml-to-mime were put on a hook so that C-c C-c would call it, this
> feature would be usable.  A suitable front-end to mml-attach-file
> could avoid asking all the annoying questions.  

mml-attach-file is the front-end used in message-mode for many years.
I quite often adjust type and disposition (inline vs. attachment).  I
don't recall any complains about the questions from our users.  Just
hit RET if you are happy with.

> It would only be necessary to document it.
>
> However, that hook could also cause trouble, since it might
> trigger by accident when users did not intend it.

It quite unlikely that users insert MML markup by accident.  When
writing about it, there is `mml-quote-region'.

> Another drawback, compared with etach-detach, is that you don't see
> what is really going to appear in the message.

C-u M-x mml-preview RET, M-x mml-preview RET

,----[ <f1> f mml-preview RET ]
| mml-preview is an interactive compiled Lisp function in `mml.el'.
| It is bound to <menu-bar> <Attachments> <Preview>, C-c RET P.
| (mml-preview &optional RAW)
| 
| Display current buffer with Gnus, in a new buffer.
| If RAW, display a raw encoded MIME message.
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]