🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
4 messages
4 total messages Started by Stephane Gibier Sat, 04 Sep 1999 00:00
[slrn] refresh groups
#51560
Author: Stephane Gibier
Date: Sat, 04 Sep 1999 00:00
26 lines
1421 bytes
Hello,

I have created a small slrn macro which refresh groups and remove the
current group if it has 0 unread articles. I am sure this macro could be
optimized because I have to call twice refresh_groups. Any ideas ?

define Smart_RefreshGroups()
{
   if( is_group_mode() )
   {
      call( "refresh_groups" );
      if( 0 == group_unread() )
      {
         call( "down" );
         call( "refresh_groups" );
      }
   }
}
definekey( "Smart_RefreshGroups", "G", "group" );

-- 
St�phane Gibier <sgibier@mail.dotcom.fr>
Voici une lieuse de chardon !
Ibvpv har puvrhfr qr yneqbaf ! 

Re: [slrn] refresh groups
#51531
Author: Dawn Owens-Nicholson
Date: Sat, 04 Sep 1999 00:00
46 lines
1913 bytes
Stephane Gibier wrote:
> I have created a small slrn macro which refresh groups and remove the
> current group if it has 0 unread articles. I am sure this macro could be
> optimized because I have to call twice refresh_groups. Any ideas ?

I too wrote a similar thing a while back, here's what I've been using:

implements ("my");
static define refresh_groups ()
{
   %!if (is_group_mode ()) return ();
   if (andelse { group_unread () == 0 } { strlen (current_newsgroup ()) })
     {
	call ("toggle_hidden");
	if (andelse { group_unread () == 0 } { strlen (current_newsgroup ()) })
	  call ("toggle_hidden");
     }
   call ("refresh_groups");
   call ("bob");
}

The whole thing will fail if it's not running in group mode (but since I was
using it for myself I skipped such code).  Uncomment the first line in the
function if you wish.  Take out the last line if you don't like jumping to
the top of the group list.

> define Smart_RefreshGroups()
> {
>    if( is_group_mode() )

I would use this instead:

     !if (is_group_mode ()) return ();

because you can make better use of the left margin.

>       call( "refresh_groups" );
>       if( 0 == group_unread() )

You might want to use

        !if (group_unread ())

instead.

Re: [slrn] refresh groups
#51544
Author: Stephane Gibier
Date: Sat, 04 Sep 1999 00:00
13 lines
1359 bytes
Thanks a lot, it works very well and it is smarter that I have wrote :-)
I have not add the call( "bob" ) statement since I want to stay around
the old cursor position after the refresh_groups. I have noticed your
notes about my previous code.

Just a remark : why to test the length of the current newsgroup ?

-- 
St�phane Gibier <sgibier@mail.dotcom.fr>
Ce soir on mange de la crique au thon
Pr fbve ba znatr qr yn gevdhr nh pba 

Re: [slrn] refresh groups
#51625
Author: Dawn Owens-Nicholson
Date: Sun, 05 Sep 1999 00:00
9 lines
1106 bytes
Stephane Gibier wrote:
> Just a remark : why to test the length of the current newsgroup ?

Because group_unread() returns 0 when you use it when no groups are listed.
This is all done in an attempt to discover whether empty groups are toggled
on (meaning empty subscribed groups are showing) or off (they're not
showing) and then to turn them off before calling refresh_groups.

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