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: Ralf Fassel
Subject: Re: How to pipe text or load a file directly into mail-mode?
Date: Wed, 03 May 2006 22:35:03 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (chestnut, linux)

* Adam Funk <a24061@yahoo.com>
| 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'


reply via email to

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