Thread View: news.software.readers
3 messages
3 total messages
Started by Scott Eberl
Wed, 18 Aug 2004 16:13
identity.sl
Author: Scott Eberl
Date: Wed, 18 Aug 2004 16:13
Date: Wed, 18 Aug 2004 16:13
6 lines
1303 bytes
1303 bytes
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.
Re: identity.sl
Author: paf the dog
Date: Wed, 18 Aug 2004 17:58
Date: Wed, 18 Aug 2004 17:58
129 lines
6014 bytes
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
Re: identity.sl
Author: Emmanuele Bassi
Date: Wed, 18 Aug 2004 19:26
Date: Wed, 18 Aug 2004 19:26
19 lines
1835 bytes
1835 bytes
* Scott Eberl [2004-08-18 18:13]: > I downloaded this macro today and read through it but don't really > understand where I'm suppose to be calling it from. You should place all the calls in order to create the identities inside a file, and then evaluate (with the "interpret" directive) that file *after* the: interpret "identity.sl" call placed inside your .slrnrc. Bye, Emmanuele. -- Emmanuele Bassi [ http://www.emmanuelebassi.net/slrn/ ] GnuPG Key fingerprint = 4DD0 C90D 4070 F071 5738 08BD 8ECC DB8F A432 0FF4
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads