🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
1 messages
1 total messages Started by J.B. Nicholson Tue, 10 Oct 2017 06:20
[slrn] Keeping the pager filled
#262336
Author: J.B. Nicholson
Date: Tue, 10 Oct 2017 06:20
92 lines
3961 bytes
Here's a interesting little insignificancy: scrolling the pager so as
to keep the pager filled.

Save the following (between but not including the #v+ and #v- lines)
to a file (say, ~/fill_article_window.sl) and then add

  interpret "/path/to/your/homedir/fill_article_window.sl"
  setkey article "fill_article_window->article_page_down" " "

to your slrnrc (change the interpret line to match to wherever you
saved the file.

Load slrn normally, find a long article, and hit space to go through
it one page at a time. When you reach the last page, slrn should only
scroll down enough to show the last lines thus keeping the article
pager filled.

Enjoy.



#v+
implements ("fill_article_window");

% TO DO: use article_go_to_line() to keep the article positioned in
% the article pager window correctly when the terminal window size
% changes. there's a hook for detecting the terminal window size
% changing.

% TO DO: rename this macro set to something better.

% TO DO: keep article list and group list filled in the display. Is
% this possible? Perhaps with clever use of jumping and scrolling.

static define article_page_down ()
{
   % Don't let prefix arguments get in the way of our call()s.
   variable prefix_arg = get_prefix_arg();
   reset_prefix_arg();
   EXIT_BLOCK
     {
	% Restore the prefix argument.
	if (prefix_arg != -1) set_prefix_argument (prefix_arg);
     }

   switch (get_next_art_pgdn_action())
     { case -1:
	  throw UsageError, "This function only works in article mode.";
     }
     { case  0:
	% Next page of the article will be displayed, or the article
	% at the cursor will be shown depending on what article the
	% cursor points to.

	% Cursor points somewhere other than the article in the
	% article pager? Do whatever the article_page_down intrinsic
	% normally does.
	if (_is_article_visible() != 3)
	  {
	     call ("article_page_down");
	     return();
	  }
	
	variable
	  article_window_size = get_article_window_size(),
	  article_lines = article_count_lines(),
	  unseen_article_lines_below_pager = article_lines - (article_window_size + article_cline_number());

	% If the number of lines in that next page is less than the
	% number of lines in the article pager, show only the
	% remaining lines without showing any indicators the pager is
	% showing lines beyond the end of the article.
	if (unseen_article_lines_below_pager < article_window_size)
	  {
	     () = article_goto_line (article_count_lines() - article_window_size + 1);
	     return ();
	  }
	else
	  {
	     % Show the full next page as the article_page_down
	     % intrinsic normally does.
	     call ("article_page_down");
	     return();
	  }
     }
     {
	% Do whatever the article_page_down intrinsic normally does.
	call ("article_page_down");
	return ();
     }
}
#v-
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