Article View: news.software.readers
Article #120471Re: slrn: Redefining detection of my posts
From: J.B. Nicholson-Owens
Date: Thu, 20 Feb 2003 23:48
Date: Thu, 20 Feb 2003 23:48
81 lines
4541 bytes
4541 bytes
Daniel E. Macks wrote:
> I'm using slrn-0.9.7.4. When browsing a group, my own posts are
> indicated by boldface of the author field. This seems to (at least in
> large part) be based on the realname variable. Is there a way to
> change the detection of "my" posts to use a regex or somesuch?
Changing realname to work as a regular expression is an option. Such a
change requires changing the slrn program. Since slrn is Free Software you
could do the change yourself or get someone to do it for you. In order to
make the change compatible with how slrn's realname currently works, you'll
probably want some way of telling slrn whether realname should be
interpreted as a regular expression or not (the default being to interpret
realname as a string).
Alternatively, you could use scoring to set the score of your posts to be a
value which will be displayed prominently in the article list.
> I use several different accounts that have different names, and I'd
> like to see all of mine (the person, not the account). Would also be
> useful for folks that use group/date-stamped or other changing munges.
This suggests another approach--if you use the same name for a certain
amount of time, only change names based on the newsgroup, you can change
$NAME and then slrn will find that. This would effectively be the same
thing as changing slrn's "realname" setting with a group_mode_hook():
#v+
implements ("my");
static variable starting_realname = get_variable_value ("realname");
static define group_mode_hook ()
{
% Change slrn's realname setting depending on what group is entered.
% Unnamed groups use the name listed in the slrnrc, $NAME, or on
% Unix-like systems, one's passwd entry (in that order). See slrn's
% manual for complete details.
variable
realname = starting_realname,
current_newsgroup_name = current_newsgroup ();
if (string_match (current_newsgroup_name, "^alt\\.", 1))
{
realname = "alt group name";
}
else if (string_match (current_newsgroup_name, "^comp\\.", 1))
{
realname = "comp group name";
}
else if (string_match (current_newsgroup_name, "font", 1))
{
realname = "font groups name";
}
set_string_variable ("realname", realname);
}
!if (register_hook ("my->group_mode_hook", "group_mode_hook"))
message ("Could not register my->group_mode_hook() with group_mode_hook().");
#v-
You can copy the above function, put it in a file (say "my_hooks.sl" in your
homedir) and then load it into slrn by adding the following to your slrnrc:
#v+
interpret "my_hooks.sl"
#v-
and then restart slrn. Now switching into a group that matches "^alt\."
will set your realname to "alt group name", switching to a group that
matches "^comp\." will make your realname "comp group name", and switching
to a group with "font" somewhere in the name will make your realname "font
groups name".
To illustrate with an example: entering alt.fonts will make your realname
"alt group name" because the check for ^alt\. matches and trumps all
subsequent checks. I think the logic of this sequence is easy enough to
understand so that you can customize it to your needs.
Identity.sl does something similar to this but with far more settings,
allows for groups of settings, and a more easily used user interface. In
exchange for the easy user interface you lose some flexibility.
Technical Details
Message-ID:
<slrnb5artf.flm.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.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mailReferences:
<slrnb58bi9.bf4.dmacks@mail1.sas.upenn.edu>Show Full Headers
Complete Article Headers
Message-ID: <slrnb5artf.flm.jbn@forestfield.org> Subject: Re: slrn: Redefining detection of my posts Date: Thu, 20 Feb 2003 23:48:21 +0000 From: "J.B. Nicholson-Owens" <jbn@forestfield.org> References: <slrnb58bi9.bf4.dmacks@mail1.sas.upenn.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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mail Newsgroups: news.software.readers Organization: Forest Field OmniMedia Lines: 80 NNTP-Posting-Host: forestfield.org (208.216.67.173) X-Trace: fu-berlin.de 1045784901 53237972 208.216.67.173 (16 [35848]) X-War-With-Iraq: no X-US-Imperialism: no Mail-Copies-To: nobody User-Agent: slrn/0.9.7.4pl2 (GNU/Linux)