From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ralf Fassel Newsgroups: gmane.emacs.help Subject: Re: How to pipe text or load a file directly into mail-mode? Date: Wed, 03 May 2006 22:35:03 +0200 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146688839 28242 80.91.229.2 (3 May 2006 20:40:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 May 2006 20:40:39 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 03 22:40:37 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 1FbO96-0005xA-FQ for geh-help-gnu-emacs@m.gmane.org; Wed, 03 May 2006 22:40:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbO95-0001DE-TY for geh-help-gnu-emacs@m.gmane.org; Wed, 03 May 2006 16:40:27 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-X-Trace: individual.net s0+RBs3ypQCH281Us7P9fAX6icJ+4BGv9yA7lumtfn4EtaDP4= User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (chestnut, linux) Cancel-Lock: sha1:pakMMxSqwV4vWDBpEfYP+ggHIOc= Original-Xref: shelby.stanford.edu gnu.emacs.help:139163 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:34786 Archived-At: * Adam Funk | 2. saves the output in a temp file and opens it with an emacs | command. If you use some well-known extension like ".perl-mail", you could configure your emacs to load those extensions as mail-mode files: Add (setq auto-mode-alist (cons '("\\.perl-mail\\'" . mail-mode) auto-mode-alist)) to your ~/.emacs. Then save the temp file to say /tmp/xxx.perl-mail and fire up emacs on that file via perls system() system("emacs /tmp/xxx.perl-mail"); | Does the program's output (emacs's input) need to be formatted in | the normal way for a mail message (with a blank line after the | headers) or the way it shows up in the Emacs mail buffer (with | "--text follows this line--" after the headers)? The temp file would need to contain what a buffer created via C-x m usually contains (i.e. the "--text follows this line--" marker and all necessary headers (To, CC, ...)). Untested, especially the usage of temp file names in /tmp. R'