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 18:11:20 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> 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)))

This will be nicer:

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




reply via email to

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