🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #257404

Re: Refreshing SLRN heders while viewing newsgroup?

#257404
From: J.B. Nicholson-Owens
Date: Fri, 25 Apr 2014 04:01
63 lines
3667 bytes
J.B. Nicholson-Owens <jbn@forestfield.org> wrote:
> You could simulate doing this with a macro. Save the following (in
> between the #v+ and #v- lines) to a file, load it from slrn, and press
> "G" to run the macro.

Here's a version that should preserve the article visibility and
zooming:

#v+
define refresh_reenter_group () 
{
   if (is_group_mode ())
     error (_function_name () + " only works in article mode!");

   % Note the article we started on and the collapse status
   % of the current thread so we can restore the cursor position
   % and thread display later.
   variable
     prefix_arg = get_prefix_arg(),
     starting_article = extract_article_header ("Message-ID"),
     thread_was_collapsed = is_thread_collapsed (),
     article_was_visible_and_current = (_is_article_visible () == 3),
     article_was_zoomed = is_article_window_zoomed (),
     starting_newsgroup = current_newsgroup ();

   % We don't want any prefix arguments to interfere with any call()s
   % we make. So we record the prefix argument, reset the prefix
   % argument, and restore the prefix argument at the end (in the
   % EXIT_BLOCK).
   reset_prefix_arg();

   EXIT_BLOCK
     {
	% Put the cursor where it was and restore the thread display.
	() = locate_header_by_msgid (starting_article, 1);
	ifnot (thread_was_collapsed) uncollapse_thread ();

	% Shows/hides the article if that's what we were looking at before.
	if (article_was_visible_and_current != (_is_article_visible () & 1))
	  call ("hide_article");

	% Zooms the article window if the article window was showing
	% the article.
	if ((_is_article_visible () & 1) and article_was_zoomed and (is_article_window_zoomed () == 0))
	  call ("zoom_article_window");

	% Restore the prefix argument.
	if (prefix_arg != -1) set_prefix_argument (prefix_arg);
     }

   % Quit to group mode, refresh the newsgroup list, and re-enter the
   % newsgroup we were in.
   call ("quit");
   call ("refresh_groups");
   set_input_string (starting_newsgroup);
   call ("add_group");
   call ("select_group");

   if (is_group_mode ())
     error ("Something went horribly wrong and we could not re-enter " + starting_newsgroup);
}
definekey ("Global->refresh_reenter_group", "G", "article");
#v-
Technical Details
Message-ID: <slrnlljnha.g4m.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.20140922.mbox.gz!border2.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail
References: <53590b16$0$9244$c3e8da3$9f400e27@news.astraweb.com> <slrnllj3ul.a2b.jbn@forestfield.org>

Show Full Headers
Complete Article Headers
Message-ID: <slrnlljnha.g4m.jbn@forestfield.org>
Subject: Re: Refreshing SLRN heders while viewing newsgroup?
Date: Fri, 25 Apr 2014 04:01:46 +0000
From: "J.B. Nicholson-Owens" <jbn@forestfield.org>
References: <53590b16$0$9244$c3e8da3$9f400e27@news.astraweb.com> <slrnllj3ul.a2b.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.20140922.mbox.gz!border2.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail
Newsgroups: news.software.readers
Organization: albasani.net
Lines: 63
X-Trace: news.albasani.net
 pPN3nInxv8Ub+kes4cesh0neeezWCJlrBeFkDS8UVH7qfWVgJyDy812K3WMK7LTCpJnHah0u13Ly2VJctmt1bA==
NNTP-Posting-Date: Fri, 25 Apr 2014 04:01:46 +0000 (UTC)
Injection-Info: news.albasani.net;
 logging-data="LszPEA8F8v8eivVkXdAWTKaH2M5uj49jRMgpgkGRnjpfFERGurLPVRNdHZHYVyPr8w8M3dAvtPljWnKEKYng/o6pGi///61DiHa2Edarvk/Udf6nBDy08VuL3wK2u+kV";
 mail-complaints-to="abuse@albasani.net"
User-Agent: slrn/1.0.1 (Linux)
Cancel-Lock: sha1:Z0bBQ6p/Pe2y6EcLb8AyUlqri74=
X-Original-Bytes: 3354