🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #150631

Re: [slrn]-different signatures for each group

#150631
From: paf the dog
Date: Thu, 24 Jun 2004 04:18
88 lines
4305 bytes
Emmanuele Bassi grumbled:
> * Scott Eberl [2004-06-21 20:10]:
> 
>> Is there a way to have multiple .signature files for slrn and based on
>> the newsgroup your posting to use that signature file accordingly?
> 
> You could use my Identity macro for this - and much more :-)
> 
> 	http://www.emmanuelebassi.net/slrn/identity.sl

Hello Emmanuele, I downloaded identity.sl and i like it a lot :-)
I made a few modifications, I thought you would like to know
First, I added kind of "anonymous" identity, which I use seldomly, and
not especially associated with a NG. The regexp is simply "^$"
I cloned static define assign () into static define anon () in which I
removed conditionals and stuff, and left only Current_ID = "anon" and
the assign_val lines. I mapped the adoption of this identity to F12 and
back to usual identity for the newsgroup to F11:
definekey ("identity->anon", "^[[24~", "article");
definekey ("identity->assign", "^[[23~", "article");

Besides, since I wanted an identity for fr.comp.* except
fr.comp.graphisme.* and fr.comp.mail, I got into trouble though I
sorted it in my my_identities.sl file this way
^fr\.comp\.graphisme\.
^fr\.comp\.mail
^fr\.comp\.

then I noticed the order in which id's regx are tested in nothing
about their position in the file. I thought it could be relative to
alphabetical sorting of the id so I changed this, that, stuff to A-this,
B-that, C-stuff so that it would be sorted so that fcg.* and fcm regx
get tested before fc.*, but il didn't work yet. I eventually changed to
A, B and C, and then I got it.
But A, B and C are not really speaking, and I like to see very fast an
explicit name when running identity->view
thus, I added a variable
interne_dfl = "",

in static define retrieve_default () I added a default value
interne_dfl = "Défaut";

in private define create (id) I added a line too
Identity[id]["int"] = interne_dfl;

I added also this:

static define set_interne (id, interne) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "int", interne);

} %}}}

so that I could add a line in the my_identities.sl file:
identity->set_interne ("id", "internal name");

in static define anon () I added:
interne_dfl = Identity[Current_ID]["int"];
just above the assign_val lines

I did the same in static define assign () where I also added, below
assign_default ();
interne_dfl = "Défaut";

and I changed static define view () to

  id = sprintf ("\nNom interne: " + interne_dfl + "\n\n" +
                "From: %s <%s@%s>\n" +
                ...
                ...

Well, this was the first time ever I touched slang thus it may probably
be dirty, and many things may be useless, but I thought it could give
you ideas to improve this already quite convenient useful script

I wished slang would support perl extended regexp, it would have been
easier to build an expression matching any fr.comp.* _except_ fcm and
fcg.* for instance. Still, this lack made me discover a little of slang
:-)

Anyway, many thanks for the script!

-- 
paf the dog
remove primate to reply
Technical Details
Message-ID: <slrncdklhp.lrq.pafbaboonlechien@chris.frigo.gla>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!internal1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.net!feeder2-1.proxad.net!news5-e.free.fr!not-for-mail
References: <slrncde90r.357.scott@turncoat.airea420.com> <slrncdefhg.3ga.zefram@wolverine.lohacker.net>

Show Full Headers
Complete Article Headers
Message-ID: <slrncdklhp.lrq.pafbaboonlechien@chris.frigo.gla>
Subject: Re: [slrn]-different signatures for each group
Date: Thu, 24 Jun 2004 04:18:25 +0000
From: paf the dog <pafbaboonlechien@neuf.fr>
References: <slrncde90r.357.scott@turncoat.airea420.com> <slrncdefhg.3ga.zefram@wolverine.lohacker.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!internal1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.net!feeder2-1.proxad.net!news5-e.free.fr!not-for-mail
Newsgroups: news.software.readers
Organization: Crashed Dogs
X-No-Archive: yes
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit
User-Agent: slrn/0.9.7.4 (Linux)
Lines: 88
NNTP-Posting-Date: 24 Jun 2004 06:18:25 MEST
NNTP-Posting-Host: 80.119.110.36
X-Trace: 1088050705 news5-e.free.fr 2062 80.119.110.36:3256
X-Complaints-To: abuse@proxad.net