From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: Create email with selected text as body? Date: Thu, 16 Dec 2010 16:53:11 +0100 Organization: SunSITE.dk - Supporting Open source Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1292564251 31308 80.91.229.12 (17 Dec 2010 05:37:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 17 Dec 2010 05:37:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 17 06:37:27 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PTT0Q-0001l8-F8 for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Dec 2010 06:37:26 +0100 Original-Received: from localhost ([127.0.0.1]:34690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTSro-0003TZ-D9 for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Dec 2010 00:28:32 -0500 Original-Path: usenet.stanford.edu!news-xfer.nntp.sonic.net!newsfeed.straub-nv.de!nuzba.szn.dk!news.szn.dk!pnx.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:lT5BNyRnD4BCE6k9aQjQkXWI93M= Original-Lines: 19 Original-NNTP-Posting-Host: 74.125.57.36 Original-X-Trace: news.sunsite.dk DXC=WCnGak^_dE\jXN@]UnT6J_YSB=nbEKnk[`Lj]JVV7UTYL^MjW:Lh^ Original-X-Complaints-To: staff@sunsite.dk Original-Xref: usenet.stanford.edu gnu.emacs.help:183347 X-Mailman-Approved-At: Fri, 17 Dec 2010 00:26:39 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77615 Archived-At: On Thu, 16 Dec 2010 11:55:20 +0100, Rainer M Krug wrote: > Hi > > Is it possible to create an email and include the selected text > automatically in the body of the email? > > Essentially, create an email as C-x m does, but to include the > selected text in the body? I don't know of a command that makes this simpler, but you can always yank the selected region with `M-w' and paste it to the buffer `C-x m' pops up. You can also write a `mail-region' interactive command that takes care of all this in a single invocation. Look at the functions `buffer-substring', `message-goto-body' and to the YANK-ACTION argument of the `compose-mail' function. It should be pretty easy to write `mail-region' using these three.