Article View: news.software.readers
Article #39730Re: [slrn] changing from line per newsgroup?
From: Jan Hlavacek
Date: Mon, 23 Mar 1998 00:00
Date: Mon, 23 Mar 1998 00:00
72 lines
2901 bytes
2901 bytes
On 23 Mar 98 04:14:10 GMT, Preben 'Peppe' Guldberg
<c928400@student.dtu.dk> wrote:
> Thus wrote Zebee Johnstone <zebee@lute.orchestra.cse.unsw.EDU.AU>:
> > I'd like to have some macro or definition in slrn that
> > changes the "from" line depending on the newsgroup.
>
> > Just want to change the realname field.
>
> > Is this possible?
>
> You can do this with article_mode_hook. This is defined in a file (eg
> .slrn.sl) that is read while reading .slrnrc if you have the following
> line in .slrn.rc
>
> interpret .slrn.sl
>
> A fictive example for me with a couple of names that applies in groups
> with either "dk" or "denmark" in the name:
>
> define article_mode_hook ()
> {
> if (is_substr (current_newsgroup (), "dk")
> or is_substr (current_newsgroup (), "denmark"))
> {
> set_string_variable ("realname", "Peppe");
> }
> else
> {
> set_string_variable ("realname", "Preben Guldberg");
> }
> }
>
>
> Note: you must enter the group where you want to post or the hook will
> not apply.
Or you can use post_hook and followup_hook, and it will always work.
define post_hook ()
{
variable newsheader = extract_article_header ("Newsgroups:");
if (is_substr (newsheader, "dk")
or is_substr (newsheader, "denmark"))
{
set_string_variable ("realname", "Peppe");
}
else
{
set_string_variable ("realname", "Preben Guldberg");
}
}
define followup_hook ()
{
post_hook ();
}
This gets executed every time you post, so unless you change the
Newsgroups: header when you edit the message, you always get the right
from line regardles how you posted. Also, it gives you more
flexibility when you crosspost to several nesgroups.
lahvak
--
Jan Hlav\'{a}\v{c}ek <lahvak@math.mps.ohio-state.edu> (BCC's will bounce)
home page: http://www.math.ohio-state.edu/~lahvak/
slrn page: http://www.math.ohio-state.edu/~lahvak/software/slrn.html
slrn documentation: http://www.math.ohio-state.edu/~lahvak/software/slrn/
Technical Details
Message-ID:
<slrn6hc01u.4hu.lahvak@math.mps.ohio-state.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:
<slrn6hbim4.hqr.zebee@lute.orchestra.cse.unsw.EDU.AU> <slrn6hbodl.1pp.c928400@urdybet.bergsoe.dtu.dk>Show Full Headers
Complete Article Headers
Message-ID: <slrn6hc01u.4hu.lahvak@math.mps.ohio-state.edu> Subject: Re: [slrn] changing from line per newsgroup? Date: Mon, 23 Mar 1998 00:00:00 +0000 From: lahvak@math.mps.ohio-state.edu (Jan Hlavacek) References: <slrn6hbim4.hqr.zebee@lute.orchestra.cse.unsw.EDU.AU> <slrn6hbodl.1pp.c928400@urdybet.bergsoe.dtu.dk> 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: 336742041 Reply-To: lahvak@math.mps.ohio-state.edu Organization: Department of Mathematics, The Ohio State University Newsgroups: news.software.readers