jbn's S-Lang code for slrn

The following Free Software macros are for slrn, a newsreader. Most of the macros are standalone and don't require anything but slrn to run.

All of this Free Software is licensed to you under the GNU General Public License (or GNU GPL) version 2 or later (just like slrn). For additional Free Software, visit my general-purpose S-Lang macro webpage.

Auto subscribe and unsubscribe

Automatically subscribe and unsubscribe to new groups.

Last tested with slrn & S-Lang 1.4.4


Automatic subscribe and unsubscribe lets you target certain groups for automatic subscription and unsubscription when they appear as new to your news server. You use slrn's unsubscribe_new_groups variable to describe how you want to treat the majority of new newsgroups then use this macro to handle the rest of the groups. This macro set installs itself into hooks exclusively so there shouldn't be a compatibility problem for anyone.

Enhanced slrn functions

A variety of macros to enhance slrn functions.

Last tested with slrn 1.0.3 & S-Lang 2.3.1


This macro set implements a number of functions intended to complement what slrn provides. For example:

More will be added to this macro set as time and need permits. This is a collection of functions I've needed in many of my own slrn projects.

Group Sort

Easily sort groups in slrn's group mode.

Last tested with slrn & S-Lang 1.4.9

group_sort-2.21.tar.gz group_sort.tar.gz

Easily sort groups in slrn's group mode with this macro set. The supported sorting methods:

This macro set will let you easily sort newsgroups in interesting ways. One of the most interesting ways to sort newsgroups is by the time you last entered a newsgroup. Another interesting method is sorting by specification with regular expressions. You toss something like the following into a text file:

% This is a comment.  It will be ignored.
# This is another comment.

# Sort alt.* groups before comp.* groups.
^alt\\. before ^comp\\.

# But I want comp.foobar to be first.
^comp\\.foobar$ first

# And I want alt.foobar to be last.
^alt\\.foobar$ last

In version 2.21 (which is pre-release quality software, think beta) you can also say:

# comp.* with unread articles before new alt.* groups with at least 23 unread articles.
^comp\\. unread before ^alt\\. new,unread=>23

Jump to Thread

Easily move the cursor within and around threads.

Last tested with slrn & S-Lang 1.4.3


Easily move the cursor in and around threads with this macro set. Here's the API:

% Move the cursor to the beginning or end of the thread.
Jump_To_Thread->beginning ();
Jump_To_Thread->end ();

% Move the cursor n threads above or below the current thread.
Integer_Type Jump_To_Thread->thread_up (Integer_Type n);
Integer_Type Jump_To_Thread->thread_down (Integer_Type n);

% Is the cursor at the beginning or end of the thread?
Integer_Type Jump_To_Thread->is_beginning ();
Integer_Type Jump_To_Thread->is_end ();

% Where is m (a message-ID) relative to the cursor?
(Integer_Type distance, Integer_Type position) = Jump_To_Thread->msgid_where (String_Type m)

Move Group

Move slrn groups into any position you want.

This has been obsoleted by slrn's set_group_order() and get_group_order() intrinsics.

Nn front-end

Make slrn look and feel like nn.

This is a work in progress.


This pre-alpha macro set is posted here to show you where I'm headed with this front-end. I am not trying to duplicate all of nn's functionality (if you want that level of nn support, use nn). In time I hope to make this a good enough nn front-end for slrn so nn users looking to switch to nn will have an easier time adjusting to slrn. Nn has a large amount of settable state and will require more time to complete. In the meantime, give this macro set a try and feel free to hack on it.

Notify Postponed Posts

Tells you when you have postponed articles.

Last tested on slrn and S-Lang 1.4.9


This macro will notify you when there are articles in slrn's postpone_directory. If you install it as documented, the notification will be displayed every time you start slrn.

Read the friendly FAQ

Make slrn get the FAQ for the current newsgroup.

Last tested on slrn and S-Lang 1.4.5


Make slrn open a web browser and get the FAQ for the current news group. I wrote this in the spirit of making it easy for people to find and read the FAQ for a newsgroup before posting in that newsgroup.

Refresh & Re-enter the Group

Fetch new news from article mode.

Last tested on slrn 1.0.3 and S-Lang 2.3.1


This macro lets you fetch new news from article mode. The macro works by refreshing group mode, re-entering the current newsgroup, and maintaining much of the state in article mode. This gives a reasonable approximation of what slrn would do if it had this feature built-in.

1.0:  Initial release with a version number.
1.1:  Fixed name of macro file in documentation so it matches filename.
      Thanks Phil Boutros (philb@philb.ca) for pointing this out.
1.2:  Added restoring article pager to the correct line of article.
1.3:  Fixed problem with zoomed article, stopped trying to do something
      when current article vanishes from server.
1.35: Fixed problem with mismatch between pointed-to article and
      article showing in pager.

rn front-end

Make slrn look and feel like rn.

This is a work in progress. But it works well enough in group mode to play with.


This is a macro set to make slrn look and feel more like rn. Trust me, some people think that's a good thing. I would rather you use only Free Software so I'm writing this macro set. This won't get you very far, but it will let you play around in group mode (somewhat), a little bit in article mode, and allow you to see straightforward well-documented code. I think you'll enjoy it. Of course, feel free to hack on this and please send me patches.


Forward multiple articles to multiple recipients.

Last tested on slrn and S-Lang 1.4.5


Forward multiple articles to all the e-mail addresses you specify. This macro will forward each article to the set of recipients, thus generating one e-mail per forwarded article.

Contrary to the name, this macro is actually quite useless for spamming. It requires manual input of e-mail addresses, manual selection of the articles to send, and only forwards articles already in slrn's article mode listing. I chose this name because it sounded cute.


Save asterisk tags between slrn sessions and re-entering group-mode.

Last tested with slrn & S-Lang 1.4.5


Stickytags allows you to keep the asterisk tags on articles after you leave article mode or quit slrn. It is completely transparent to other macros (it runs entirely in slrn's hooks), has no dependencies and should pose no compatibility problem for anyone.


A set of macros to make slrn's cursor wrap.

Last tested with slrn & S-Lang 1.4.4

Depends on enhanced_slrn.sl.


This macro set makes your cursor act as if the group and article lists are circular. When the cursor reaches one end of the list it continues moving in the same direction from the other end. All of slrn's functions are wrapped with macros so everything behaves as it normally does.

In order to provide this functionality Wraptastic puts macro wrappers around a large number of slrn's functions. Macros that do not use the Wraptastic wrappers will probably not behave in the same way as these macros.

J.B. Nicholson (jbn@forestfield.org)