Thread View: news.software.readers
7 messages
7 total messages
Started by asf... Lloyd Zusman
Wed, 25 Jun 1997 00:00
Pre-post hook in slrn?
Author: asf... Lloyd Zusman
Date: Wed, 25 Jun 1997 00:00
Date: Wed, 25 Jun 1997 00:00
20 lines
1042 bytes
1042 bytes
I'm using slrn version 0.9.4.1, and I'd like to be able to intercept an article I'm posting and perform some extra checking before it goes out. Based on the results of this checking, I might go ahead and post the article, or I might want to re-edit. Is there a pre-post hook in slrn which will allow me to write a slang macro to handle this case? I didn't see anything obvious in the source code, but perhaps I'm missing something. Thanks in advance. -- Lloyd Zusman l...@asfast.com
Re: Pre-post hook in slrn?
Author: lah... Jan Hlavacek
Date: Wed, 25 Jun 1997 00:00
Date: Wed, 25 Jun 1997 00:00
26 lines
1480 bytes
1480 bytes
On 25 Jun 1997 01:13:06 GMT, Lloyd Zusman <asf...@asfast.com> wrote:
>I'm using slrn version 0.9.4.1, and I'd like to be able to intercept
>an article I'm posting and perform some extra checking before it goes
>out. Based on the results of this checking, I might go ahead and post
>the article, or I might want to re-edit.
>
>Is there a pre-post hook in slrn which will allow me to write a slang
>macro to handle this case?
>
As the README.macros says:
The present implementation does not provide many hooks into the
newsreader. More capabilities will be added in subsequent releases.
I would love to see pre-post and pre-display hooks in slrn.
lahvak
--
Jan Hlav\'{a}\v{c}ek
lah...@math.ohio-state.edu (Blind Carbon Copies will bounce)
www: http://www.math.ohio-state.edu/~lahvak/ is back!
Re: Pre-post hook in slrn?
Author: lah... Jan Hlavacek
Date: Sun, 29 Jun 1997 00:00
Date: Sun, 29 Jun 1997 00:00
24 lines
1502 bytes
1502 bytes
On 29 Jun 1997 09:47:48 GMT, John E. Davis <da...@space.mit.edu> wrote:
>On 25 Jun 1997 05:15:33 GMT, Jan Hlavacek <lah...@math.ohio-state.edu>
>wrote:
>>I would love to see pre-post and pre-display hooks in slrn.
>
>0.9.4.2 will feature a `post_hook' and a `post_filter_hook'. What
>should a pre-display hook do?
After I replied to your email, I remembered one more thing:
Set some variables on "by article" basis, for example:
Change attribution string acording to the language of the message (look for
few words in unquoted lines of the message which will indicate the language).
lahvak
--
Jan Hlav\'{a}\v{c}ek
lah...@math.ohio-state.edu (Blind Carbon Copies will bounce)
www: http://www.math.ohio-state.edu/~lahvak/ is back!
Re: Pre-post hook in slrn?
Author: da... John E. Davis
Date: Sun, 29 Jun 1997 00:00
Date: Sun, 29 Jun 1997 00:00
32 lines
1300 bytes
1300 bytes
On 25 Jun 1997 05:15:33 GMT, Jan Hlavacek <lah...@math.ohio-state.edu>
wrote:
>I would love to see pre-post and pre-display hooks in slrn.
0.9.4.2 will feature a `post_hook' and a `post_filter_hook'. What
should a pre-display hook do? Here is a sample post_filter_hook:
define post_filter_hook (file)
{
variable rsp;
variable cmd;
forever
{
rsp = get_response ("NnIi",
"Select Filter? \001None, \001Ispell");
if ((rsp == 'i') or (rsp == 'I'))
cmd = "ispell -x";
else return;
() = system (Sprintf ("%s '%s'", cmd, file, 2));
}
}
This example makes it clear that other filter options can be added.
--John
Re: Pre-post hook in slrn?
Author: asf... Lloyd Zusman
Date: Sun, 29 Jun 1997 00:00
Date: Sun, 29 Jun 1997 00:00
43 lines
1819 bytes
1819 bytes
On 29 Jun 1997 09:47:48 GMT, John E. Davis <da...@space.mit.edu> wrote:
> On 25 Jun 1997 05:15:33 GMT, Jan Hlavacek <lah...@math.ohio-state.edu>
> wrote:
> >I would love to see pre-post and pre-display hooks in slrn.
>
> 0.9.4.2 will feature a `post_hook' and a `post_filter_hook'. What
> should a pre-display hook do? Here is a sample post_filter_hook:
>
> define post_filter_hook (file)
> {
> variable rsp;
> variable cmd;
>
> forever
> {
> rsp = get_response ("NnIi",
> "Select Filter? \001None, \001Ispell");
>
> if ((rsp == 'i') or (rsp == 'I'))
> cmd = "ispell -x";
> else return;
>
> () = system (Sprintf ("%s '%s'", cmd, file, 2));
> }
> }
>
> This example makes it clear that other filter options can be added.
This is great!
Will there be a way from within 'post_filter_hook' to tell slrn not to
post the article? One method I can think of would be to use the
return value from 'post_filter_hook' to control this. Or perhaps the
'error' routine could be used ... ???
--
Lloyd Zusman
l...@asfast.com
Re: Pre-post hook in slrn?
Author: asf... Lloyd Zusman
Date: Mon, 30 Jun 1997 00:00
Date: Mon, 30 Jun 1997 00:00
36 lines
2063 bytes
2063 bytes
On 30 Jun 1997 03:10:27 GMT, John E. Davis <da...@space.mit.edu> wrote:
> On 29 Jun 1997 14:44:41 GMT, Lloyd Zusman <asf...@asfast.com>
> wrote:
> >Will there be a way from within 'post_filter_hook' to tell slrn not to
> >post the article? One method I can think of would be to use the
> >return value from 'post_filter_hook' to control this. Or perhaps the
> >'error' routine could be used ... ???
>
> Currently, slrn has an intrinsic function called `set_input_string'
> that may be used to provide a response for prompts requesting multiple
> character input (See README.macros). However, this does not work when
> slrn prompts for a single character such as `Y' or `N' from a yes/no
> prompt. For that reason, slrn 0.9.4.2 will provide the intrinsic
> function `set_input_chars' that may be used for such prompts.
>
> After slrn calls the filter hook, it will prompt for a single
> character requestion whether or not to post, postpone, etc... You can
> provide the answer from the hook by calling
>
> set_input_chars ("n");
>
> before returning from the hook.
Yep ... that'll do it. Thanks ... I'm really looking forward to
0.9.4.2 now!
How much longer before it comes out?
--
Lloyd Zusman
l...@asfast.com
Re: Pre-post hook in slrn?
Author: da... John E. Davis
Date: Mon, 30 Jun 1997 00:00
Date: Mon, 30 Jun 1997 00:00
26 lines
1696 bytes
1696 bytes
On 29 Jun 1997 14:44:41 GMT, Lloyd Zusman <asf...@asfast.com>
wrote:
>Will there be a way from within 'post_filter_hook' to tell slrn not to
>post the article? One method I can think of would be to use the
>return value from 'post_filter_hook' to control this. Or perhaps the
>'error' routine could be used ... ???
Currently, slrn has an intrinsic function called `set_input_string'
that may be used to provide a response for prompts requesting multiple
character input (See README.macros). However, this does not work when
slrn prompts for a single character such as `Y' or `N' from a yes/no
prompt. For that reason, slrn 0.9.4.2 will provide the intrinsic
function `set_input_chars' that may be used for such prompts.
After slrn calls the filter hook, it will prompt for a single
character requestion whether or not to post, postpone, etc... You can
provide the answer from the hook by calling
set_input_chars ("n");
before returning from the hook.
--John
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