help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: sending a buffer by mail


From: Eric Abrahamsen
Subject: Re: sending a buffer by mail
Date: Wed, 30 Aug 2017 17:52:22 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Jean-Christophe Helary <jean.christophe.helary@gmail.com> writes:

>> On Aug 31, 2017, at 8:16, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>> 
>> Jean-Christophe Helary <jean.christophe.helary@gmail.com> writes:
>> 
>>> c-x m creates an empty mail buffer, but say I have a buffer that I need to 
>>> send by mail, what magic command would do the trick?
>> 
>> M-x insert-buffer?
>
> No. I'm thinking more of something like "send-buffer-as-mail" so that I can 
> do all my editing in the buffer and the command puts all that into a mail and 
> I'm done.

Well, that sounds like a very thin wrapper around insert-buffer:

(defun send-buffer-as-mail ()
  (interactive)
  (let ((str (buffer-string)))
    (compose-mail)
    (message-goto-body)
    (insert str)))

That's pretty much exactly what you'd get if you ran "C-x m", "M-x
insert-buffer", [choose buffer], "<RET>".

Alternately, there are a few functions that do this from Org mode, so
you can have nice structured text editing, and then email it.

Eric




reply via email to

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