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: How to pipe text or load a file directly into mail-mode? Date: Wed, 03 May 2006 21:16:41 +0300 Organization: SunSITE.dk - Supporting Open source Message-ID: <86psivug6u.fsf@gothmog.pc> References: <864q075gmf.fsf@gothmog.pc> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146681833 2847 80.91.229.2 (3 May 2006 18:43:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 May 2006 18:43:53 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 03 20:43:52 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FbMJq-0001F1-60 for geh-help-gnu-emacs@m.gmane.org; Wed, 03 May 2006 20:43:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbMJq-0004OQ-0c for geh-help-gnu-emacs@m.gmane.org; Wed, 03 May 2006 14:43:26 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!t-online.de!news.tele.dk!feed118.news.tele.dk!dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix) Cancel-Lock: sha1:nPHUt5+3LtW/1aOwIbM1kpl2eTw= Original-Lines: 27 Original-NNTP-Posting-Host: 62.103.39.226 Original-X-Trace: news.sunsite.dk DXC=hNHI@GRS_ck2IML^Mjg2:ak; I7eU]g6nT6d; jI9io1h; :^oPZ]0c Original-X-Complaints-To: staff@sunsite.dk Original-Xref: shelby.stanford.edu gnu.emacs.help:139159 comp.emacs:92096 Original-To: help-gnu-emacs@gnu.org 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:34783 Archived-At: On Wed, 3 May 2006 16:05:54 +0100, Adam Funk wrote: > On 2006-05-03, Giorgos Keramidas wrote: >> On Wed, 3 May 2006 12:29:03 +0100, Adam Funk wrote: >>> I'd like the output of a Perl program to end up in an Emacs mail-mode >>> buffer, ready to proofread, edit and then send with C-c C-c. I don't >>> mind whether my program >>> >>> 1. pipes the output to an emacs command, or >>> >>> 2. saves the output in a temp file and opens it with an emacs command. > > I forgot to make something clear: emacs is *not* running when the Perl > program starts. The Perl program generates the unedited message and > then launches emacs. Oh! I misunderstood you then. Sorry. This is kind of backwards. I usually let Emacs start other programs as inferior processes, instead of the other way around. Perhaps someone more experienced with Emacs can help you with this (i.e. you could write a function that can be called with: perl script.pl | emacs --batch -f foo-function and let `foo-function' read from the standard input stream. But I know far too little to do that myself.