🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #255916

Re: Some more slrn questions

#255916
From: Adam Funk
Date: Wed, 30 Oct 2013 10:54
59 lines
2884 bytes
On 2013-10-24, Sandman wrote:

> 2. Piping posts
> So, what I would love is for slrn, when I hit "f", to pipe the current post 
> to a perl script, which massages it the way I want to and then opens it in 
> the editor of my choice, and when saved, I go back to slrn. How would such 
> a process work and look like, if possible?

Sorry if this has already been answered in this thread, but I have
something just like this for custom-forwarding.  Here's the line in my
~/.slrnrc file:

#v+
interpret ".slrn/forward-custom.sl"
#v-

That refers to the following forward-custom.sl file:

#v+
define custom_forward ()
{
    variable filename, return_code, ext_cmd;

    filename = strcat("/tmp/slrnfwd-", string(_time()), "-", string(getpid()), ".news");

    return_code = save_current_article(filename);
    if (return_code != 0)  return(return_code);

    ext_cmd = strcat("~/.slrn/forward-custom.perl  ", filename);
    return_code = system(ext_cmd);
    if (return_code != 0)  return(return_code);
    
    return_code = remove(filename);
    if (return_code != 0)  return(return_code);
}

definekey ("custom_forward", "F", "article");
#v-

The forward-custom.perl script is a horrible mess that I now have
trouble reading, but it reads the temp file, fiddles with it,
overwrites it, then calls:

#v+
    $status = system('emacs', '-nw', $edit_file, '-f', 'mail-mode');
#v-

The perl script waits there until emacs finishes, then ends & passes
control back to the slrn custom_forward, which in my case does nothing
else (I have to use the emacs mail-mode keys to send the mail message
after editing it).

HTH.


-- 
The internet is quite simply a glorious place. Where else can you find
bootlegged music and films, questionable women, deep seated xenophobia
and amusing cats all together in the same place?         [Tom Belshaw]
Technical Details
Message-ID: <0557kaxdl.ln2@news.ducksburg.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <slrnl6iooj.6hm.mr@irc.sandman.net>

Show Full Headers
Complete Article Headers
Message-ID: <0557kaxdl.ln2@news.ducksburg.com>
Subject: Re: Some more slrn questions
Date: Wed, 30 Oct 2013 10:54:56 +0000
From: Adam Funk <a24061@ducksburg.com>
References: <slrnl6iooj.6hm.mr@irc.sandman.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: news.software.readers
Organization: $CABAL
Lines: 59
X-Trace: individual.net IIOxQfbJF1soV+xYLQpDdAr+1XPD1I+8jMlDZudIo4tV7orkuN
X-Orig-Path: news.ducksburg.com!not-for-mail
Cancel-Lock: sha1:xBhPm0QKWKmrQCasX01nvkvWsk0=
 sha1:kvx1XxHKClaxPt2j043VpkwZHvI=
User-Agent: slrn/pre1.0.2-9 (Linux)
X-Original-Bytes: 2588