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: Fri, 5 May 2006 09:36:24 +0100 Message-ID: <8dfri3-5ng.ln1@news.ducksburg.com> References: <86vesme7tk.fsf@gothmog.pc> <86slnpbjn0.fsf@gothmog.pc> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1146822078 10431 80.91.229.2 (5 May 2006 09:41:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 5 May 2006 09:41:18 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 05 11:41:15 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 1Fbwo5-0003fq-1c for geh-help-gnu-emacs@m.gmane.org; Fri, 05 May 2006 11:41:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fbwo4-00065w-ED for geh-help-gnu-emacs@m.gmane.org; Fri, 05 May 2006 05:41:04 -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,comp.emacs Original-Lines: 35 Original-X-Trace: individual.net W0D43pZnZDBDDJVwO3W5+QDUNeYnis1lZsNXrScIZlIpQEttD1 X-Orig-Path: news.ducksburg.com!news User-Agent: slrn/0.9.8.1pl1 (Debian) Original-Xref: shelby.stanford.edu gnu.emacs.help:139229 comp.emacs:92110 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:34853 Archived-At: On 2006-05-04, Giorgos Keramidas wrote: >> That external program I want to be a Perl script that puts some stuff >> at the beginning of the article, prefaces it with my custom headers, >> and then opens it in Emacs in mail-mode (so I can use my ~/.mailrc >> aliases and all the other great stuff that Emacs does). Maybe I need >> to store the article in a /tmp file then load it into the Perl >> program, instead of piping it into the program's STDIN. > > You don't need Perl for that, I guess. It's fairly easy to write a > function in Elisp that does all you need and call it at Emacs startup, ITYM "easy for someone who knows how to write Elisp"! > i.e. a _very_ simplistic one could be: > >| (defun slrn-setup-post (&optional filename) >| "Load a file and set things up for posting it as a `mail' >| message through Emacs." >| (interactive) >| (if filename >| (insert-filename)) >| (beginning-of-buffer) >| (insert-string "From: foo@bar.example.net\n\n") >| (mail-mode)) > > Then you can set up slrn to use as its `$EDITOR' your Emacs wrapper > script, which would run: > > emacs filename -f slrn-setup-post > > No need for Perl if you have the full Elisp languaeg at your hands :) But you've given me a lot to start with. Thanks!