help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to pipe text or load a file directly into mail-mode?


From: Adam Funk
Subject: Re: How to pipe text or load a file directly into mail-mode?
Date: Fri, 5 May 2006 09:36:24 +0100
User-agent: slrn/0.9.8.1pl1 (Debian)

On 2006-05-04, Giorgos Keramidas <keramida@ceid.upatras.gr> 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!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]