🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #262336

[slrn] Keeping the pager filled

#262336
From: 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-
Technical Details
Message-ID: <slrnotopl0.981.jbn@forestfield.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.(126883).mbox.7z!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <slrnotopl0.981.jbn@forestfield.org>
Subject: [slrn] Keeping the pager filled
Date: Tue, 10 Oct 2017 06:20:16 +0000
From: "J.B. Nicholson" <jbn@forestfield.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.(126883).mbox.7z!not-for-mail
Newsgroups: news.software.readers
Organization: solani.org
Lines: 92
X-Trace: solani.org 1507616416 28663 eJwNxsEBwEAEBMCWLJYo507ov4RkXkMLRKcHw7nclsUp+Zsq80DXLkqun8xkM7Yg0QYTnXn9AwxjEGQ= (10 Oct 2017 06:20:16 GMT)
X-Complaints-To: abuse@news.solani.org
NNTP-Posting-Date: Tue, 10 Oct 2017 06:20:16 +0000 (UTC)
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:W4HSo7hI7UQS+5BN0Kc4ydg3CZs=
X-NNTP-Posting-Host: eJwNysEBwCAIA8CVUAih42CK+4/Q3vvguVKMRAYuLuc8LWqcnW7VhGQVng0fls02nn1C/3ttfSLVESY=
X-User-ID: eJwFwQEBwCAMAzBLsLdlkwPl8y+BhJ+mvCAKbHY4xJm86MQRl4y6reH/rDt8nLUzusobiPEAFlIREg==
X-Received-Bytes: 3894
X-Received-Body-CRC: 3721019472