🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
5 messages
5 total messages Started by John Klassa Wed, 17 Jun 1998 00:00
[SLRN] using hooks to filter replies/posts/followups before editing
#41555
Author: John Klassa
Date: Wed, 17 Jun 1998 00:00
24 lines
1469 bytes
I've been trying to figure out how to filter a reply/post/followup before
it's presented to me, for editing.

For example, I wrote a script called "cite" which I use in conjunction with
exmh to generate replies that look similar to what "supercite" (in the
emacs world) creates...  A message is piped through "cite", then presented
to me for editing (whereupon I add my own verbiage and so forth).

I'd like to do the same thing with slrn -- that is, generate a skeleton
reply/followup/post file, ready for editing, that's been processing by
whatever arbitrary filter I'd like -- before I see/edit it for the first
time.

Can this be done?  I read through the docs that come with slrn, and did a
web search, but neither route got me to an answer.

Thanks,
John

-- 
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><

Re: [SLRN] using hooks to filter replies/posts/followups before editing
#41576
Author: Dirk Bernhardt
Date: Thu, 18 Jun 1998 00:00
13 lines
1219 bytes
On 17 Jun 1998 18:49:38 GMT, John Klassa <klassa@aursgh.aur.alcatel.com> wrote:
> I'd like to do the same thing with slrn -- that is, generate a skeleton
> reply/followup/post file, ready for editing, that's been processing by
> whatever arbitrary filter I'd like -- before I see/edit it for the first
> time.

You could try setting your slrn editor variable to a script that pipes the
article through `cite' and then calls your favourite editor on it.

Krid

Re: [SLRN] using hooks to filter replies/posts/followups before editing
#41669
Author: John E. Davis
Date: Tue, 23 Jun 1998 00:00
19 lines
1341 bytes
On 23 Jun 1998 15:28:56 GMT, John Klassa <klassa@aursgh.aur.alcatel.com>
wrote:
>The problem with this solution is that the file it [the script] gets has
>already been munged by slrn.  Is there some way to get at the *original*
>article (untouched by slrn)?

If you intend to use an external program to quote an article, then you
might try using

    set quote_string ""

in your .slrnrc file.
-- 
John E. Davis                   Center for Space Research/AXAF Science Center
617-258-8119                    One Hampshire St., Building NE80-6019
http://space.mit.edu/~davis     Cambridge, MA  02139-4307

Re: [SLRN] using hooks to filter replies/posts/followups before editing
#41684
Author: root
Date: Tue, 23 Jun 1998 00:00
85 lines
2935 bytes
On 23 Jun 1998 15:38:20 GMT, John E. Davis <davis@space.mit.edu> wrote:
>On 23 Jun 1998 15:28:56 GMT, John Klassa <klassa@aursgh.aur.alcatel.com>
>wrote:
>>The problem with this solution is that the file it [the script] gets has
>>already been munged by slrn.  Is there some way to get at the *original*
>>article (untouched by slrn)?
>
>If you intend to use an external program to quote an article, then you
>might try using
>
>    set quote_string ""
>
>in your .slrnrc file.
>-- 
>John E. Davis                   Center for Space Research/AXAF Science Center

Hi there.  Thought you might be interested in the `sendmail' version of your
print.c code for slrn:

=============================================================================
#ifdef USE_WIN32_PRINT_CODE /*{{{*/

struct _Slrn_Print_Type
{
   HANDLE h;
   int error_status;
};

static    char printer_name_buf [256];

int win32_close_printer (Slrn_Print_Type *p)
{
char cmd_buf[256];
   if ((p == NULL) || (p->h == (HANDLE)NULL))
     return 0;
   slrn_fclose ((FILE *)(p->h));
/* sprintf should be in slrn_posix_system, not here: */
   sprintf(cmd_buf, "start /m notepad /p %s", printer_name_buf);
   slrn_posix_system (cmd_buf, 1);
   remove(printer_name_buf);
   slrn_free ((char *) p);
   return 0;
}

Slrn_Print_Type *win32_open_printer (void)
{
   HFILE h;
   Slrn_Print_Type *p;

   if (NULL == (p = (Slrn_Print_Type *) SLmalloc (sizeof (Slrn_Print_Type))))
     return NULL;
   
   memset ((char *) p, 0, sizeof(Slrn_Print_Type));

   if ((HFILE)NULL ==
	(h = (HFILE)slrn_open_tmpfile (printer_name_buf, "w")))
     {
	perror("fopen failed in win32_open_printer.");
	slrn_free ((char *) p);
	return NULL;
     };
   p->h = (HANDLE)h;
   return p;
}

int win32_write_to_printer (Slrn_Print_Type *p, char *buf, unsigned int len)
{
   if ((p == NULL) || (p->h == (HFILE)NULL) || (p->error_status != 0))
     return -1;
   if (fwrite(buf, len, 1, (FILE *)(p->h)) < 1)
     {
	p->error_status = 1;
	perror("Write to printer failed.");
	return -1;
     };
   
   return 0;
}

/*}}}*/
#endif				       /* USE_WIN32_PRINT_CODE */


Re: [SLRN] using hooks to filter replies/posts/followups before editing
#41692
Author: John Klassa
Date: Tue, 23 Jun 1998 00:00
18 lines
1238 bytes
On 18 Jun 1998 09:08:04 GMT, Dirk Bernhardt wrote:

->You could try setting your slrn editor variable to a script that pipes the
->article through `cite' and then calls your favourite editor on it.

I thought, at first, that this was a great idea...

The problem with this solution is that the file it [the script] gets has
already been munged by slrn.  Is there some way to get at the *original*
article (untouched by slrn)?
 
Thanks...

-- 
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads