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: Thu, 04 May 2006 07:24:07 +0300 Organization: SunSITE.dk - Supporting Open source Message-ID: <86vesme7tk.fsf@gothmog.pc> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146717663 10725 80.91.229.2 (4 May 2006 04:41:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 May 2006 04:41:03 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 04 06:41:01 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 1FbVe3-0006Gs-P0 for geh-help-gnu-emacs@m.gmane.org; Thu, 04 May 2006 06:40:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbVe3-0003yl-5y for geh-help-gnu-emacs@m.gmane.org; Thu, 04 May 2006 00:40:55 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!news2.volia.net!news.banetele.no!dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix) Cancel-Lock: sha1:jyJ1jFl4tzeLdgXxNuLeNEJ2sG4= Original-Lines: 30 Original-NNTP-Posting-Host: 62.103.39.226 Original-X-Trace: news.sunsite.dk DXC=dUPnBXPk[@3OPCTD3`iC24YSB=nbEKnk; L^Mj72:ak; I7eU]76nT6d; jI9i?LgWmV_?FcA5 Original-X-Complaints-To: staff@sunsite.dk Original-Xref: shelby.stanford.edu gnu.emacs.help:139173 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:34796 Archived-At: On Wed, 03 May 2006 22:35:03 +0200, Ralf Fassel wrote: > * 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"); Ah! This is a great idea. You don't even have to use a special extension for this. Emacs parses command-line arguments in order, so you can use: system("emacs /tmp/xxxxxx -f mail-mode"); to bring up Emacs, open `/tmp/xxxxxx' and then run `mail-mode' :)