Article View: news.software.readers
Article #51531Re: [slrn] refresh groups
From: Dawn Owens-Nicholson
Date: Sat, 04 Sep 1999 00:00
Date: Sat, 04 Sep 1999 00:00
46 lines
1913 bytes
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.
Technical Details
Message-ID:
<slrn7t2vol.l1b.bluemoon@ux6.cso.uiuc.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn7t2p4j.9b2.sgibier@hermes.olympus.fr>Show Full Headers
Complete Article Headers
Message-ID: <slrn7t2vol.l1b.bluemoon@ux6.cso.uiuc.edu> Subject: Re: [slrn] refresh groups Date: Sat, 04 Sep 1999 00:00:00 +0000 From: bluemoon@ux6.cso.uiuc.edu (Dawn Owens-Nicholson) References: <slrn7t2p4j.9b2.sgibier@hermes.olympus.fr> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 521106298 Organization: University of Illinois at Urbana-Champaign User-Agent: slrn/0.9.5.7 (UNIX) Newsgroups: news.software.readers