Thread View: news.software.readers
1 messages
1 total messages
Started by J.B. Nicholson-Owens
Wed, 17 Sep 1997 00:00
[slrn] bugfix macro for locate_header_by_msgid
Author: J.B. Nicholson-Owens
Date: Wed, 17 Sep 1997 00:00
Date: Wed, 17 Sep 1997 00:00
76 lines
2954 bytes
2954 bytes
A problem: The slrn built-in "locate_header_by_msgid" uncollapses threads
unnecessarily.
A demonstration:
(1) enter a newsgroup with at least one collapsed thread and move the
pointer to the top header in that thread.
(2) execute: message (extract_article_header ("Message-ID")); then save
the message-ID you get in the copy buffer or write it down.
(3) move the pointer somewhere else.
(4) execute: call ("locate_header_by_msgid"); and enter the message-ID
you saved in step 2.
(5) the pointer moves to the correct place, but notice how that thread is
now uncollapsed?
A solution: I've written a macro to fix this. Use
bugfix_locate_header_by_msgid instead of
"call("locate_header_by_msgid");" and things should work fine
(unless you've coded expecting the bug).
% a bugfix replacement for call("locate_header_by_msgid") % -*- slang -*-
define bugfix_locate_header_by_msgid ()
{
% With collapsed articles, locate_header_by_msgid will unnecessarily uncollapse a
% thread. This function fixes that and only uses the non-buggy portions of
% locate_header_by_msgid.
variable sought_message_ID = read_mini ("Enter Message-Id", "", "");
!if (strlen (sought_message_ID))
return ();
variable starting_header = extract_article_header ("Message-ID");
call ("header_bob"); % top of article list
do
{
variable
thread_was_collapsed = is_thread_collapsed (),
t_size = thread_size ();
_for (1, t_size, 1)
{
variable position = ();
if (case (sought_message_ID, extract_article_header ("Message-ID")))
return ();
if (position == 1)
uncollapse_thread ();
else if (andelse
{ position == t_size; }
{ thread_was_collapsed; })
collapse_thread ();
if (position != t_size)
() = header_down (1);
}
}
while (header_down (1));
set_input_string (starting_header);
call ("locate_header_by_msgid"); % moving to starting place
set_input_string (sought_message_ID);
call ("locate_header_by_msgid"); % calling the non-buggy part
}
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