🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
6 messages
6 total messages Started by Ivan The Not-So-Bad Thu, 24 Apr 2014 13:01
Refreshing SLRN heders while viewing newsgroup?
#257373
Author: Ivan The Not-So-Bad
Date: Thu, 24 Apr 2014 13:01
10 lines
1549 bytes
So let's say I'm in SLRN and reading through news.software.readers. I'm 5
threads in to a lengthy discussion. It's been a while since I've updated the
group so there are probably new responses in the thread. I don't want to lose
my place, but would like to see new articles that have come in since I entered
the newsgroup. 

Unless I'm missing something, the only way I'm able to get new articles for the
newsgroup is to leave the newsgroup and come back in again?

Someone please tell me I'm missing something very obvious.
Re: Refreshing SLRN heders while viewing newsgroup?
#257392
Author: Whiskers
Date: Thu, 24 Apr 2014 14:20
38 lines
3107 bytes
On 2014-04-24, Ivan The Not-So-Bad <1suf41n@yahoo.com> wrote:
> So let's say I'm in SLRN and reading through news.software.readers.
> I'm 5 threads in to a lengthy discussion. It's been a while since I've
> updated the group so there are probably new responses in the thread. I
> don't want to lose my place, but would like to see new articles that
> have come in since I entered the newsgroup. 
>
> Unless I'm missing something, the only way I'm able to get new
> articles for the newsgroup is to leave the newsgroup and come back in
> again?
>
> Someone please tell me I'm missing something very obvious.

Articles are scored, sorted, threaded, etc, when you enter the group.
So no, you can't insert more recent articles into your view of the group
while actually viewing that group.

There are various strategies for keeping track of discussions you are
following.  

The most obvious is the score file; create a score file entry for the
Subject (or From or Message-ID or other headers) you want to follow, and
that score will be shown against any articles or threads that match it
when next you enter that group.

An alternative is to use the 'stickytags' macro from "jbn's S-Lang code
for slrn" <http://forestfield.org/slrn/> which keeps tagged (marked with
a star *) articles visible in the group's article list when you
'catchup' or leave the group or close slrn.  

A clunky but moderately effective method is to make sure that the
articles you are interested in are not 'marked as read' before you leave
the group; they will then be shown again when next you open the group.

-- 
-- ^^^^^^^^^^
--  Whiskers 
-- ~~~~~~~~~~
Re: Refreshing SLRN heders while viewing newsgroup?
#257402
Author: J.B. Nicholson-Owens
Date: Thu, 24 Apr 2014 22:27
83 lines
4733 bytes
Ivan The Not-So-Bad <1suf41n@yahoo.com> wrote:
> So let's say I'm in SLRN and reading through news.software.readers. I'm 5
> threads in to a lengthy discussion. It's been a while since I've updated the
> group so there are probably new responses in the thread. I don't want to lose
> my place, but would like to see new articles that have come in since I entered
> the newsgroup. 

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.

#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 (),
     starting_newsgroup = current_newsgroup ();

   % We don't want any prefix arguments to interfere with any call()s
   % we make. So we recorded the prefix argument, reset the prefix
   % argument below, 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 ();
	
	% 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-

There are some tradeoffs with this approach you will want to consider:

- refreshing all of the groups ends up downloading data for groups
  you're not immediately interested in. I don't know how to get slrn
  to only refresh group data for the group you're in. If there is a
  way to do that, I believe this macro is clear enough that you can
  improve it.

- Any error raised on group reentry will stop this macro prematurely
  and not put the cursor back to where it should be and not restore
  the thread display for the current display thread. It's not clear
  what /should/ be done here -- show the user the error, put the
  cursor back where it should go, or something else? It's not clear
  that dropping in an attempt to catch and ignore errors is wise.

- You may be prompted on group reentry about how many articles to read
  when entering the group. It wasn't clear what /should/ be done to
  better handle this situation.

- With the exception of the article you were on when you pressed "G",
  read articles will seem to disappear from the article list when the
  macro is finished. Relatedly, no attempt is made to preserve the
  thread display for read, starred, or numerically tagged articles.
  Other uncollapsed threads in the display may be recollapsed when you
  reenter the group. Fixing all of this is possible (I wrote a macro
  to do this with starred articles) but fixing any this will take more
  time to store and restore the data. 
Re: Refreshing SLRN heders while viewing newsgroup?
#257404
Author: 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-
Re: Refreshing SLRN heders while viewing newsgroup?
#257427
Author: Adam Funk
Date: Fri, 25 Apr 2014 20:12
25 lines
2164 bytes
On 2014-04-24, Whiskers wrote:

> Articles are scored, sorted, threaded, etc, when you enter the group.
> So no, you can't insert more recent articles into your view of the group
> while actually viewing that group.
>
> There are various strategies for keeping track of discussions you are
> following.  
>
> The most obvious is the score file; create a score file entry for the
> Subject (or From or Message-ID or other headers) you want to follow, and
> that score will be shown against any articles or threads that match it
> when next you enter that group.
>
> An alternative is to use the 'stickytags' macro from "jbn's S-Lang code
> for slrn" <http://forestfield.org/slrn/> which keeps tagged (marked with
> a star *) articles visible in the group's article list when you
> 'catchup' or leave the group or close slrn.  

I heartily endorse the stickytags macro & use it a lot.


-- 
Unix is a user-friendly operating system. It's just very choosy about
its friends.
Re: Refreshing SLRN heders while viewing newsgroup?
#257753
Author: J.B. Nicholson-Owens
Date: Sat, 24 May 2014 02:41
119 lines
5951 bytes
I <jbn@forestfield.org> wrote:
> Here's a version that should preserve the article visibility and
> zooming [...]

Here's a version which adds the ability to preserve the thread display
and retains articles marked as read when you fetch new articles. This
change more effectively conveys the illusion that you can update the
article list from article mode. Install StickyTags to save/restore *'d
articles as well (see http://forestfield.org/slrn/#stickytags for
StickyTags).

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

   % 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).
   variable prefix_arg = get_prefix_arg();
   reset_prefix_arg();
   EXIT_BLOCK
     {
	% Restore the prefix argument.
	if (prefix_arg != -1) set_prefix_argument (prefix_arg);
     }

   variable
     % Initialized for useful initial values.
     starting_article = extract_article_header ("Message-ID"),
     starting_newsgroup = current_newsgroup (),
     article_was_visible_and_current = (_is_article_visible () == 3),

     % Initialized later and generally initialized to indicate type.
     thread_collapse_status = Assoc_Type[Integer_Type],
     thread_was_collapsed = 0,
     article_was_zoomed = is_article_window_zoomed (),
     i = 0,
     t = 0,
     message_ID = "",
     message_ID_set = Assoc_Type[Integer_Type];

   % Store collapse status for unread articles. Threads with all-read
   % articles will disappear when we re-enter the group because read
   % articles won't be around to set collapse status on.
   call ("header_bob");
   do
     {
	t = thread_size ();
	thread_was_collapsed = is_thread_collapsed ();
	message_ID = "";
	message_ID_set = Assoc_Type[Integer_Type];

	uncollapse_thread ();
	for (i = 1; i <= t; i++)
	  {
	     % We track collapse status for all articles.
	     thread_collapse_status[extract_article_header ("Message-ID")] = thread_was_collapsed;

	     % We care about how we leave the thread because the user
	     % might be running something in a hook that tracks thread
	     % collapse status.
	     if (i != t) () = header_down (1);
	     else if (thread_was_collapsed) collapse_thread ();
	  }
     }
   % Go to the next thread.
   while (header_down (1));

   % 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 ())
     throw InternalError, "Something went horribly wrong and we could not re-enter " + starting_newsgroup;

   % Working around a bug here: normally we'd restore the thread
   % display THEN replace the cursor where it was (switching the two
   % next stanzas). But locate_header_by_msgid(m, 1) collapses the
   % thread display. Therefore we restore the thread display /after/
   % all locate_header_by_msgid(m, 1) calls.

   % Put the cursor where it was and restore the article view only if
   % the article wasn't already in the header list.
   if (locate_header_by_msgid (starting_article, 1))
     {
	% 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) && article_was_zoomed && (is_article_window_zoomed () == 0))
	  call ("zoom_article_window");
     }

   % Fetch from the server all of the articles that were in the
   % article list. This should help convey the illusion that the only
   % effect this macro has is adding new articles to the article list.
   foreach message_ID (thread_collapse_status) using ("keys")
     () = locate_header_by_msgid (message_ID, 1);

   % Restore the thread display and reposition the cursor on the
   % article we were on when this macro began.
   foreach message_ID,thread_was_collapsed (thread_collapse_status) using ("keys", "values")
     {
	() = locate_header_by_msgid (message_ID, 0);
	if (thread_was_collapsed) collapse_thread ();
	else uncollapse_thread ();
     }
   () = locate_header_by_msgid (starting_article, 0);
}
definekey ("Global->refresh_reenter_group", "G", "article");
#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