[Top][All Lists]

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

Re: sending a buffer by mail

From: John Mastro
Subject: Re: sending a buffer by mail
Date: Wed, 30 Aug 2017 18:55:47 -0700

Eric Abrahamsen <> wrote:
>> 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))))

The difference is likely irrelevant, but you can still use
`insert-buffer' rather than consing a string of the buffer's contents:

(defun send-buffer-as-mail ()
  (let ((buf (current-buffer)))
      (insert-buffer buf))))

reply via email to

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