Article View: news.software.readers
Article #48971Re: [slrn macro] End of Thread?
From: Dawn Owens-Nicholson
Date: Sun, 30 May 1999 00:00
Date: Sun, 30 May 1999 00:00
30 lines
1643 bytes
1643 bytes
Thomas Schultz wrote:
> How can I tell whether I'm at the end of a thread in an slrn macro?
There's more than one way to do it, but you could do something like this:
define is_at_end_of_thread ()
{
if (is_group_mode ())
error (_function_name () + " doesn\'t work in group mode!");
variable
thread_was_collapsed = is_thread_collapsed (),
starting_point = extract_article_header ("Message-ID");
EXIT_BLOCK % put thread back as it was
{
() = locate_header_by_msgid (starting_point, 0);
if (thread_was_collapsed) collapse_thread ();
}
collapse_thread (); % go to top of thread
uncollapse_thread ();
() = header_down (thread_size () - 1); % go to end of thread
return (extract_article_header ("Message-ID") == starting_point);
}
This will return boolean depending on whether the cursor is at the end of
the thread or not.
Technical Details
Message-ID:
<slrn7l103g.qd8.bluemoon@ux6.cso.uiuc.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:
<slrn7ku79b.16m.tststs@starflower.tststs.ddns.org>Show Full Headers
Complete Article Headers
Message-ID: <slrn7l103g.qd8.bluemoon@ux6.cso.uiuc.edu> Subject: Re: [slrn macro] End of Thread? Date: Sun, 30 May 1999 00:00:00 +0000 From: bluemoon@ux6.cso.uiuc.edu (Dawn Owens-Nicholson) References: <slrn7ku79b.16m.tststs@starflower.tststs.ddns.org> 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: 483595050 Organization: University of Illinois at Urbana-Champaign User-Agent: slrn/0.9.5.6 (UNIX) Newsgroups: news.software.readers