🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #154058

Re: identity.sl

#154058
From: paf the dog
Date: Wed, 18 Aug 2004 17:58
129 lines
6014 bytes
Scott Eberl grumbled:
> I downloaded this macro today and read through it but don't really
> understand where I'm suppose to be calling it from. Do I run this from a
> command prompt or is there some how a way to call it from within slrn?
> Sorry in advance if I appear totally stupid. I was an OE user for a long
> time before I saw the errors in my ways and now am trying to learn the
> ins and outs of slrn which appears to be a much more capable reader.

you don't call it

you have to make your own file (say, my_identities.sl) associating an
identity to a newsgroup or a group of newsgroups.

see, for instance in mine, for fr.comp.graphisme.* I have put

identity->add_new ("B", "^fr\.comp\.graphisme\.");
identity->set_interne ("B", "graphisme");
identity->set_from ("B", "pafgibbonlechien", "neuf.fr");
identity->set_real ("B", "paf le chien");
identity->set_signature ("B", "/home/seb/.pafbabouin");
identity->set_followupstring ("B", "%r a grommelé:");
identity->set_replystring ("B", "%r a grommelé:");

you do such thing for each group of newsgroups

beware that the order in which regexps are tested is not exactly the
alphabetical order of the IDs, nor from top to bottom of the file. I
have put something in this newsgroup a while ago about it, which I paste
below since you wont find it on google (XNAy habit)

you then have to source identity.sl, *then* my_identities.sl in your
.slrnrc file
interpret ".slrn/identity.sl"
interpret ".slrn/my_identities.sl"

read the source, it is full of informations

============= Date: Thu, 24 Jun 2004 06:19:05 +0200 ====================

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: <slrnci765q.4hk.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!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!freenix!proxad.net!feeder2-1.proxad.net!news2-e.free.fr!not-for-mail
References: <slrnci6vt0.uu0.scott@turncoat.airea420.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrnci765q.4hk.pafbaboonlechien@chris.frigo.gla>
Subject: Re: identity.sl
Date: Wed, 18 Aug 2004 17:58:05 +0000
From: paf the dog <pafbaboonlechien@neuf.fr>
References: <slrnci6vt0.uu0.scott@turncoat.airea420.com>
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!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!freenix!proxad.net!feeder2-1.proxad.net!news2-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-1
Content-Transfer-Encoding: 8bit
User-Agent: slrn/0.9.7.4 (Linux)
Lines: 129
NNTP-Posting-Date: 18 Aug 2004 19:58:05 MEST
NNTP-Posting-Host: 80.119.110.32
X-Trace: 1092851885 news2-e.free.fr 18626 80.119.110.32:1954
X-Complaints-To: abuse@proxad.net