🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
1 messages
1 total messages Started by Dawn Owens-Nicholson Tue, 15 Sep 1998 00:00
[slrn] prev_high_score -- a macro like slrn's intrinsic next_high_score
#43247
Author: Dawn Owens-Nicholson
Date: Tue, 15 Sep 1998 00:00
90 lines
3245 bytes
This macro will let you go up the header list stopping at high scoring
articles along the way (or issuing an error message if there are no such
articles above the cursor).  This is exactly like slrn's intrinsic
next_high_score, except this macro goes up the header list, not down.

If you're going to use Looptastic (most recent version is in
<slrn6vthej.11g.bluemoon@ux6.cso.uiuc.edu>), you don't need to download
this.  prev_high_score() is included there.

% In a way, the opposite of next_high_score   % -*- mode: slang; mode: fold -*-
%
% Copyright 1998 J.B. Nicholson-Owens
% Author: J.B. Nicholson-Owens
% Title: prev_high_score
% Version: 1.0
% Requires: slrn 0.9.5.3 or greater, S-Lang 1.0 or greater

define prev_high_score ()                                               %{{{
{
   if (is_group_mode ())
     error (_function_name () + " doesn\'t work in group mode!");

   variable
     starting_article = extract_article_header ("Message-ID"),
     starting_thread_was_collapsed = is_thread_collapsed (),
     thread_head_article = "";

   USER_BLOCK0
     {
	if (get_header_flags () & HEADER_HIGH_SCORE)
	  {
	     if (is_article_visible ()) call ("scroll_dn");
	     return ();
	  }
     }

   USER_BLOCK1
     {
	set_input_string (starting_article);
	call ("locate_header_by_msgid");
	if (starting_thread_was_collapsed) collapse_thread ();
	error ("No more high scoring articles.");
     }

   % move cursor to the head of the thread
   collapse_thread ();
   uncollapse_thread ();
   thread_head_article = extract_article_header ("Message-ID");
   if (thread_head_article != starting_article)
     {
	set_input_string (starting_article);
	call ("locate_header_by_msgid");
	() = header_up (1);
	while (extract_article_header ("Message-ID") != thread_head_article)
	  {
	     X_USER_BLOCK0 ();
	     () = header_up (1);
	  }
	X_USER_BLOCK0 ();
     }
   if (starting_thread_was_collapsed) collapse_thread ();
   !if (header_up (1)) X_USER_BLOCK1 ();

   variable
     thread_was_collapsed = 0,
     t_size = 0,
     index = 0;

   do
     {
	thread_was_collapsed = is_thread_collapsed ();
	!if (thread_was_collapsed) collapse_thread ();
	t_size = thread_size ();
	uncollapse_thread ();
	() = header_down (t_size - 1);

	for (index = t_size; index; index--)
	  {
	     X_USER_BLOCK0 ();
	     if (index != 1) () = header_up (1);
	  }
	if (thread_was_collapsed) collapse_thread ();
     }
   while (header_up (1));
   X_USER_BLOCK1 ();
}

%}}}

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