From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: sending a buffer by mail Date: Wed, 30 Aug 2017 17:52:22 -0700 Message-ID: <871snsd0e1.fsf@ericabrahamsen.net> References: <05596771-5F19-4254-848C-77F6E66233A6@gmail.com> <87a82gfxyl.fsf@ericabrahamsen.net> <85C51987-1B1D-494B-A2A1-700190E68A73@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1504140878 14027 195.159.176.226 (31 Aug 2017 00:54:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 31 Aug 2017 00:54:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 31 02:54:34 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnDke-0003Nk-ML for geh-help-gnu-emacs@m.gmane.org; Thu, 31 Aug 2017 02:54:32 +0200 Original-Received: from localhost ([::1]:53383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnDkl-0000Q3-R1 for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Aug 2017 20:54:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnDkF-0000Pq-I8 for help-gnu-emacs@gnu.org; Wed, 30 Aug 2017 20:54:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnDkC-0001vP-E6 for help-gnu-emacs@gnu.org; Wed, 30 Aug 2017 20:54:07 -0400 Original-Received: from [195.159.176.226] (port=42404 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dnDkC-0001v9-76 for help-gnu-emacs@gnu.org; Wed, 30 Aug 2017 20:54:04 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dnDjm-0000n7-0q for help-gnu-emacs@gnu.org; Thu, 31 Aug 2017 02:53:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:f/A6uAWx8RN4nTIW1TNQRnKQ3/0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:114142 Archived-At: Jean-Christophe Helary writes: >> On Aug 31, 2017, at 8:16, Eric Abrahamsen wrote: >> >> Jean-Christophe Helary 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], "". 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