all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: sending a buffer by mail
Date: Wed, 30 Aug 2017 17:52:22 -0700	[thread overview]
Message-ID: <871snsd0e1.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 85C51987-1B1D-494B-A2A1-700190E68A73@gmail.com

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	other threads:[~2017-08-31  0:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 23:00 sending a buffer by mail Jean-Christophe Helary
2017-08-30 23:16 ` Eric Abrahamsen
2017-08-31  0:46   ` Jean-Christophe Helary
2017-08-31  0:52     ` Eric Abrahamsen [this message]
2017-08-31  1:11       ` Eric Abrahamsen
2017-08-31  1:55         ` John Mastro
2017-08-31  2:04           ` Eric Abrahamsen
2017-08-31  4:43           ` Teemu Likonen
2017-09-21 13:05             ` Jean-Christophe Helary
2017-08-31  4:54           ` Bob Newell
2017-08-31  0:38 ` Mario Castelán Castro
2017-09-07 21:24 ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871snsd0e1.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.