Article View: news.software.readers
Article #39924Re: [slrn] changing from line per newsgroup?
From: Jan Hlavacek
Date: Sat, 04 Apr 1998 00:00
Date: Sat, 04 Apr 1998 00:00
51 lines
2785 bytes
2785 bytes
On 4 Apr 1998 01:47:42 GMT, lottifran <goo+!XXX!@ouverture.it> wrote:
> Anyway seems that your function doesn't work very well for me..
> Only if I make a followup to an article the function works without problem,
> while if I post a new article "extract_article_header" always exits with a
> null string.
Which isn't surprising, after looking at the source code. Slrn calls
post_hook _before_ it asks you for newsgroup, and rightly so, as this
allow to set newsgroup and subject from the hook. Anyway, this should
finally work:
define post_hook ()
{
variable user_wants_confirm = get_variable_value ("confirm_actions");
variable yn, subject;
variable group = current_newsgroup ();
if (user_wants_confirm)
{
yn = tolower (
get_response ("yYnN\r",
"Are you sure you want to post? [\001Y]es \001No"));
if (yn == 'n')
{
set_input_chars ("n");
return;
}
else set_input_chars ("y");
}
group = read_mini ("Newsgroup", "", group);
subject = read_mini ("Subject", "", "");
% set_input_string (group + "\n" + subject); % for s-lang >1.0
set_input_string (Sprintf ("%s\n%s", group, subject, 2));
if (is_substr (group, "test"))
set_string_variable ("custom_headers", "X-bla: bla");
else set_string_variable ("custom_headers", "");
}
It would be nice if read_mini start with cursor at the end of line just
as slrn builtin prompt does.
lahvak
--
Jan Hlav\'{a}\v{c}ek <lahvak@math.mps.ohio-state.edu> (BCC's will bounce)
home page: http://www.math.ohio-state.edu/~lahvak/
slrn page: http://www.math.ohio-state.edu/~lahvak/software/slrn.html
slrn documentation: http://www.math.ohio-state.edu/~lahvak/software/slrn/
Technical Details
Message-ID:
<slrn6ibq93.hht.lahvak@math.mps.ohio-state.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn6hbim4.hqr.zebee@lute.orchestra.cse.unsw.EDU.AU> <slrn6hbodl.1pp.c928400@urdybet.bergsoe.dtu.dk> <slrn6hc01u.4hu.lahvak@math.mps.ohio-state.edu> <slrn6hc1vv.pbp.zebee@lute.orchestra.cse.unsw.EDU.AU> <slrn6hc5f6.56j.lahvak@math.mps.ohio-state.edu> <slrn6hhkf0.7la.zebee@zipper.zip.com.au> <slrn6hipoe.88m.lahvak@mingus.mps.ohio-state.edu> <slrn6ib49u.p10.goo+!XXX!@artemide.section9.net>Show Full Headers
Complete Article Headers
Message-ID: <slrn6ibq93.hht.lahvak@math.mps.ohio-state.edu> Subject: Re: [slrn] changing from line per newsgroup? Date: Sat, 04 Apr 1998 00:00:00 +0000 From: lahvak@math.mps.ohio-state.edu (Jan Hlavacek) References: <slrn6hbim4.hqr.zebee@lute.orchestra.cse.unsw.EDU.AU> <slrn6hbodl.1pp.c928400@urdybet.bergsoe.dtu.dk> <slrn6hc01u.4hu.lahvak@math.mps.ohio-state.edu> <slrn6hc1vv.pbp.zebee@lute.orchestra.cse.unsw.EDU.AU> <slrn6hc5f6.56j.lahvak@math.mps.ohio-state.edu> <slrn6hhkf0.7la.zebee@zipper.zip.com.au> <slrn6hipoe.88m.lahvak@mingus.mps.ohio-state.edu> <slrn6ib49u.p10.goo+!XXX!@artemide.section9.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.mbox.zip!not-for-mail X-Deja-AN: 340764488 Organization: Department of Mathematics, The Ohio State University Reply-To: lahvak@math.mps.ohio-state.edu Newsgroups: news.software.readers