From: Giorgos Keramidas <keramida@ceid.upatras.gr>
Subject: Re: How to pipe text or load a file directly into mail-mode?
Date: Thu, 04 May 2006 23:49:23 +0300 [thread overview]
Message-ID: <86slnpbjn0.fsf@gothmog.pc> (raw)
In-Reply-To: o92qi3-sl1.ln1@news.ducksburg.com
On Thu, 4 May 2006 20:46:32 +0100, Adam Funk <a24061@yahoo.com> wrote:
> On 2006-05-04, Ralf Fassel <ralfixx@gmx.de> wrote:
>> Well, via '-nw' you tell emacs to use the tty as input, but the tty is
>> already used by perl. Do you really need '-nw'? If you really need
>> -nw, you could try something along the lines of
>>
>> system("emacs -nw $tempfile -f mail-mode </dev/tty");
>>
>> I.e. use shell input redirection to the controlling tty. I have no
>> idea how robust that would be, and would rather get rid of the '-nw'.
>
> Maybe it would help if I explained what I'm *really* trying to do. I
> get usenet access by opening an xterm, logging into a server and
> running slrn. I really like like slrn except that I can't customize
> forwarding articles by e-mail the way I'd like, so I want to bind a
> slrn key to a command that just pipes the current article to an
> external program.
>
> 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,
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 :)
next prev parent reply other threads:[~2006-05-04 20:49 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-03 11:29 How to pipe text or load a file directly into mail-mode? Adam Funk
2006-05-03 14:26 ` Giorgos Keramidas
2006-05-03 15:05 ` Adam Funk
2006-05-03 18:16 ` Giorgos Keramidas
2006-05-03 19:05 ` Adam Funk
2006-05-03 20:35 ` Ralf Fassel
2006-05-04 4:24 ` Giorgos Keramidas
2006-05-04 10:49 ` Adam Funk
2006-05-04 13:16 ` Peter Dyballa
2006-05-04 16:43 ` Ralf Fassel
2006-05-04 19:46 ` Adam Funk
2006-05-04 20:49 ` Giorgos Keramidas [this message]
2006-05-05 8:36 ` Adam Funk
2006-05-05 14:26 ` Giorgos Keramidas
2006-05-05 11:17 ` Reiner Steib
2006-05-05 13:54 ` Adam Funk
2006-05-05 12:13 ` Ralf Fassel
2006-05-04 17:13 ` Paul Lalli
2006-05-04 19:27 ` Adam Funk
2006-05-05 21:39 ` John Sullivan
2006-05-09 11:00 ` Adam Funk
2006-05-09 11:48 ` Ralf Fassel
2006-05-09 12:15 ` Adam Funk
2006-05-09 14:16 ` Adam Funk
2006-05-09 14:30 ` Ralf Fassel
2006-05-10 8:23 ` Adam Funk
2006-05-10 12:11 ` Ralf Fassel
2006-05-10 12:22 ` Adam Funk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86slnpbjn0.fsf@gothmog.pc \
--to=keramida@ceid.upatras.gr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.