From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adam Funk Newsgroups: gmane.emacs.help Subject: Re: How to pipe text or load a file directly into mail-mode? Date: Wed, 3 May 2006 20:05:49 +0100 Message-ID: References: <864q075gmf.fsf@gothmog.pc> <86psivug6u.fsf@gothmog.pc> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1146685247 15490 80.91.229.2 (3 May 2006 19:40:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 May 2006 19:40:47 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 03 21:40:46 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 1FbND6-0003Lp-6a for geh-help-gnu-emacs@m.gmane.org; Wed, 03 May 2006 21:40:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbND5-0004eq-JL for geh-help-gnu-emacs@m.gmane.org; Wed, 03 May 2006 15:40:31 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 36 Original-X-Trace: individual.net G+yOhE8AJJqxFbbGofRQCg6bc7TMZuSgb1YrjA3WXXivpapsSq X-Orig-Path: news.ducksburg.com!news User-Agent: slrn/0.9.8.1pl1 (Debian) Original-Xref: shelby.stanford.edu gnu.emacs.help:139162 comp.emacs:92097 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:34785 Archived-At: On 2006-05-03, Giorgos Keramidas wrote: > 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. To me it seemed perfectly obvious what I meant, if you know what I mean. That's why I get other people to proofread bigger things! > 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. I'll look at from that angle and see if I can come up with something (but my elisp is really bad). Thanks.