Article View: news.software.readers
Article #47971Re: I like slrn!
From: Peppe
Date: Tue, 13 Apr 1999 00:00
Date: Tue, 13 Apr 1999 00:00
81 lines
3341 bytes
3341 bytes
Thus wrote tony summerfelt <tsummerfelt1@myspleenhome.com>
> On 6 Apr 1999 09:27:22 GMT, Ralph Sontag wrote:
> > Btw: Is there a "body search" in slrn? Subject and authorsearch are
> > great, but sometimes I want to look through the bodies.
Thanks for the script. I have a couple of suggestions though:
> %this is the fsearch.sl
> %
> define newsgroup_search (criteria)
> {
> variable flags;
> flags= get_header_flags ();
This should go inside the loop to take effect on each article.
> uncollapse_threads ();
> do
> {
> if (re_search_article (criteria))
> {
> call ("show_article");
I get an error "show_article not in current keymap". Anyway, the
article is already shown after re_search_article().
> call ("uncatchup");
As you do set_header_flags() below, this is not necessarry. Actually
it will undelete messages that were marked deleted.
> return;
> }
> set_header_flags (flags);
> }
> while (header_down (1));
> }
May I propose instead
define newsgroup_search (criteria)
{
variable flags, n = 0;
do
{
if ( andelse {n == 0} {is_thread_collapsed ()})
{
n = thread_size ();
uncollapse_thread ();
}
flags = get_header_flags ();
if (re_search_article (criteria))
return 1;
set_header_flags (flags);
if (n == 1)
collapse_thread ();
if (n)
n--;
}
while (header_down (1));
return 0;
}
where I have added handling of threads. If they are collapsed,
collapse them after searching if no articles matched.
The return value can be used to show a message, if the search failed.
If anyone are interested, I am working on a revised version that will
stay put in article mode (rather than go to the last message), if no
matching message was found.
Peppe
--
Preben Guldberg __/-\__ Q: How many Microsoft employees does
c928400@student.dtu.dk (o o) it take to change a lightbulb?
---------------------oOOo (_) oOOo A: Just one.
http://www.student.dtu.dk/~c928400 They're good at screwing things up.
Technical Details
Message-ID:
<slrn7h7eqp.3c6.c928400@urdybet.pbk.dk>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:
<7du1vh$gab$2@news.inet.tele.dk> <slrn7g5dgu.nk.kew@localhost.localdomain> <7dvkfe$a1p$2@news.inet.tele.dk> <slrn7g7qkg.6m2.sgibier@hermes.olympus.fr> <7eck1q$cqd$1@narses.hrz.tu-chemnitz.de> <slrn7go2cj.3vvjt5f.tsummerfelt1@co146453-a.kico1.on.wave.home.com>Show Full Headers
Complete Article Headers
Message-ID: <slrn7h7eqp.3c6.c928400@urdybet.pbk.dk> Subject: Re: I like slrn! Date: Tue, 13 Apr 1999 00:00:00 +0000 From: c928400@student.dtu.dk (Peppe) References: <7du1vh$gab$2@news.inet.tele.dk> <slrn7g5dgu.nk.kew@localhost.localdomain> <7dvkfe$a1p$2@news.inet.tele.dk> <slrn7g7qkg.6m2.sgibier@hermes.olympus.fr> <7eck1q$cqd$1@narses.hrz.tu-chemnitz.de> <slrn7go2cj.3vvjt5f.tsummerfelt1@co146453-a.kico1.on.wave.home.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.mbox.zip!not-for-mail X-Deja-AN: 466050412 X-Complaints-To: usenet@news.net.uni-c.dk X-Trace: news.net.uni-c.dk 924039899 15856 130.225.71.226 (13 Apr 1999 21:44:59 GMT) Organization: Home of Peppe User-Agent: slrn/0.9.5.4 (UNIX) Reply-To: c928400@student.dtu.dk NNTP-Posting-Date: 13 Apr 1999 21:44:59 GMT Newsgroups: news.software.readers