🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
13 messages
13 total messages Started by Scott Eberl Mon, 21 Jun 2004 18:10
[slrn]-different signatures for each group
#150451
Author: Scott Eberl
Date: Mon, 21 Jun 2004 18:10
2 lines
1074 bytes
Is there a way to have multiple .signature files for slrn and based on
the newsgroup your posting to use that signature file accordingly?
Re: [slrn]-different signatures for each group
#150448
Author: Keith
Date: Mon, 21 Jun 2004 19:35
485 lines
15304 bytes
Scott Eberl <scott@airea420.com> wrote:
> Is there a way to have multiple .signature files for slrn and based on
> the newsgroup your posting to use that signature file accordingly?

 Have a look at the identity.sl macro. 

% -*- mode: slang; mode: fold -*-
%
% identity.sl - a macro for assuming various identities on a per-newsgroup
%               basis.
%
% Copyright (C) 2000-2002 Emmanuele Bassi <emmanuele.bassi@iol.it>
%
% This file may be redistributed and / or modified under the terms of the
% GNU General Public License, version 2, as published by the Free Software
% Foundation.
%
% Version: 2.6.0 - Sun,  2 Jun 2002 23:58:45 +0200

#iffalse % Documentation %{{{
Description:

This macro allows the user to assign variable values, concerning his/hers
identity, on a per-newsgroup basis: that is, to change some of the displayed
informations depending on which newsgroup he/she is posting on a determined
moment.

Installation and Usage:

Make SLRN interpret this macro, with the usual line:
  
  interpret "identity.sl"

inside your slrnrc file.

Inside another file, that will be interpreted _after_ identity.sl, put
a line like this:

  identity->add_new ("id", "newsgroup");

Where "id" it's a mnemonic ID representing the identity and "newsgroup"
represents the newsgroup (or a regular expression matching more than one
group) on which you want the Identity to be used in.  This procedure
creates a new Identity with the default values, taken from SLRN's
resource file.

If you have one or more identities you want to share across many groups,
instead of creating a awkward regular expression, you may use the clone method:

  identity->clone ("old_id", "new_id");

This method clones an identity (marked by "old_id") into a new one (marked by
"new_id"). Just remember to change the regular expression of the new identity
with the set_regexp method (see below).

To modify each detail of your identity, you have wrappers to the
(private) modify() function:

identity->set_from ("id", "username", "hostname");
identity->set_real ("id", "realname");
identity->set_replyto ("id", "reply-to");
identity->set_signature ("id", "/path/to/.signature");
identity->set_signoffstring ("id", "signoff_string");
identity->set_followupstring ("id", "followup_string");
identity->set_replystring ("id", "reply_string");
identity->set_customheaders ("id", "custom_headers");
identity->set_followupcustomheaders ("id", "followup_custom_headers");
identity->set_replycustomheaders ("id", "reply_custom_headers");
identity->set_regexp ("id", "regular_expression");

Note 1: All of these wrappers accept, as parameters, the ID of the identity you
want to change and the parameter you want to be changed. The parameter has the
same syntax used by SLRN, so use it as you'd write it in the SLRN resource file.

Note 2: in the set_signature() procedure, you'll have to specify the entire path
to the signature file; otherwise, SLRN will search the file in the current
directory.

Note 3: the set_regexp() changes the regular expression for the identity: don't
use it, unless you know what you are doing.

  Viewing your identity:

To view the Identity you are using on a group, use the "ESC I" escape sequence.

History:
v2.6.0	added the `clone' method, for duplicating an identity.
v2.5.4	interpreting this macro before setting the related variables in the
        slrn-rc file now works (many thanks to Tomasz Sienicki); corrected the
	`Stack Underflow' error shown while entering in identity-less groups;
	more tighter checks on variables;
v2.5.3	newline escaped in the view() method;
v2.5.2  stronger check when registering hooks;
v2.5.1	changed the hooks, so that posting from the groups pane also uses
        identity->assign().
v2.5.0  fixed a bug that occurred while entering in a newsgroup without an
        identity;
v2.4.0  more variables: followup_string, reply_string, *custom_headers,
        signoff_string (thanks to Arkadiusz 'Jo Joro' Sochala);
v2.3.0	more extensive identity informations showed in the popup window;
v2.2.0	identities are now indexed by an id (thanks to J.B. Nicholson-Owens);
v2.1.1	where possible, s/"error (sprintf"/verror;
v2.1.0	some clean-ups; remove the nested foreach() in modify();
v2.0.0	added `hostname' and `username' to the list of mutable variables;
        added the set_*() wrappers to the create() and modify() methods;
v1.1.0  added regexp matching for identities spanning more than one group;
v1.0.0	initial release;

#endif %}}}

implements ("identity");

% Main identities variable %{{{
private variable
  Identity = Assoc_Type [];
%}}}

% Default values %{{{
private variable
  username_dfl = "",
  hostname_dfl = "",
  realname_dfl = "",
  replyto_dfl = "",
  signature_dfl = "",
  organization_dfl = "",
  signoffstring_dfl = "",
  customheaders_dfl = "",
  followupcustomheaders_dfl = "",
  replycustomheaders_dfl = "",
  replystring_dfl = "",
  followupstring_dfl = "";
%}}}

% Current identity key %{{{
private variable Current_ID = "";

%}}}

static define assign_default () %{{{
{
  set_string_variable ("username", username_dfl);
  set_string_variable ("hostname", hostname_dfl);
  set_string_variable ("signature", signature_dfl);
  set_string_variable ("realname", realname_dfl);
  set_string_variable ("replyto", replyto_dfl);
  set_string_variable ("organization", organization_dfl);
  set_string_variable ("signoff_string", signoffstring_dfl);
  set_string_variable ("followup_string", followupstring_dfl);
  set_string_variable ("custom_headers", customheaders_dfl);
  set_string_variable ("followup_custom_headers", followupcustomheaders_dfl);
  set_string_variable ("reply_custom_headers", replycustomheaders_dfl);
  set_string_variable ("reply_string", replystring_dfl);
} %}}}

static define retrieve_default () %{{{
{
  username_dfl = get_variable_value ("username");
  hostname_dfl = get_variable_value ("hostname");
  realname_dfl = get_variable_value ("realname");
  replyto_dfl = get_variable_value ("replyto");
  signature_dfl = get_variable_value ("signature");
  organization_dfl = get_variable_value ("organization");
  signoffstring_dfl = get_variable_value ("signoff_string");
  customheaders_dfl = get_variable_value ("custom_headers");
  followupcustomheaders_dfl = get_variable_value ("followup_custom_headers");
  replycustomheaders_dfl = get_variable_value ("reply_custom_headers");
  replystring_dfl = get_variable_value ("reply_string");
  followupstring_dfl = get_variable_value ("followup_string");
} %}}}

private define create (id) %{{{
{
  if (0 == strlen (id))
    return;

  % Sanity check.
  if (assoc_key_exists (Identity, id))
    {
      verror ("Identity: id %s already exists.", id);
      return;
    }
  
  % Add a new hash.
  Identity[id] = Assoc_Type [];
  
  % Save identity.
  Identity[id]["regx"] = "*";
  Identity[id]["user"] = username_dfl;
  Identity[id]["host"] = hostname_dfl;
  Identity[id]["real"] = realname_dfl;
  Identity[id]["r_to"] = replyto_dfl;
  Identity[id]["sign"] = signature_dfl;
  Identity[id]["org"] = organization_dfl;
  Identity[id]["fol_s"] = followupstring_dfl;
  Identity[id]["rep_s"] = replystring_dfl;
  Identity[id]["cus_h"] = customheaders_dfl;
  Identity[id]["fol_ch"] = followupcustomheaders_dfl;
  Identity[id]["rep_ch"] = replycustomheaders_dfl;
  Identity[id]["sig_s"] = signoffstring_dfl;
} %}}}

private define modify (id, key, value) %{{{
{
  !if (typeof (value) == String_Type)
    verror ("Identity: the value of %s must be a string", value);
  
  if ((0 == strlen (id)) or (0 == strlen (key)))
    return;

  if (assoc_key_exists (Identity, id))
    if (assoc_key_exists (Identity[id], key)) 
      Identity[id][key] = value;
    else
      verror ("Identity: key %s does not exists in %s", key, id);
  else
    verror ("Identity: an identity \`%s\' does not exists", id);

} %}}}

private define assign_val (var, key, default) %{{{
{
  % some sanity checks...
  % 1. Current_ID != "";
  !if (strlen (Current_ID))
    return;
  
  % 2. variable already set;
  if (0 == strcmp (get_variable_value (var), Identity[Current_ID][key]))
    return;
  
  % 3. no variable;
  !if (strlen (Identity[Current_ID][key]))
    {
      % 4. variable already set;
      !if (0 == strcmp (get_variable_value (var), default))
	set_string_variable (var, default);
      
      return;
    }
  
  set_string_variable (var, Identity[Current_ID][key]);
} %}}}

% Wrappers {{{
static define add_new (id, news_re) %{{{
{
  if ((0 == strlen (id)) or (0 == strlen (news_re)))
    return;

  create (id); modify (id, "regx", news_re);

} %}}}

static define clone (old, new) %{{{
{
  !if ((typeof (old) == String_Type) and (typeof (new) == String_Type))
    error ("Identity: invalid values in the clone method");

  !if (assoc_key_exists (Identity, old))
    verror ("Identity: id %s does not exist.", old);

  create (new);

  % expensive, but unavoidable.
  foreach (Identity[old]) using ("keys") {
    variable key = ();

    Identity[new][key] = Identity[old][key];
  }

}

static define set_regexp (id, news_re) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "regx", news_re);

} %}}}

static define set_from (id, username, hostname) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "user", username); modify (id, "host", hostname);

} %}}}

static define set_signature (id, signature) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "sign", signature);

} %}}}

static define set_real (id, realname) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "real", realname);

} %}}}

static define set_replyto (id, reply_to) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "r_to", reply_to);

} %}}}

static define set_signoffstring (id, signoff_string) %{{{
{
  if (0 == strlen (id))
    return;

   modify (id, "sig_s", signoff_string);

} %}}}

static define set_organization (id, organization) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "org", organization);

} %}}}

static define set_followupstring (id, followup_string) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "fol_s", followup_string);

} %}}}

static define set_replycustomheaders (id, reply_custom_headers) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "rep_ch", reply_custom_headers);

} %}}}

static define set_followupcustomheaders (id, followup_custom_headers) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "fol_ch", followup_custom_headers);

} %}}}

static define set_customheaders (id, custom_headers) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "cus_h", custom_headers);

} %}}}

static define set_replystring (id, reply_string) %{{{
{
  if (0 == strlen (id))
    return;

  modify (id, "rep_s", reply_string);

} %}}}
% End wrappers }}}

static define assign () %{{{
{
  variable newsgroup = current_newsgroup ();

  if (0 == strlen (newsgroup))
    return;

  foreach (Identity) using ("keys")
    {
      variable id = ();

      if (0 != string_match (newsgroup, Identity[id]["regx"], 1))
	{
	  Current_ID = id;
	  
	  % assign values.
	  assign_val ("username", "user", username_dfl);
	  assign_val ("hostname", "host", hostname_dfl);
          assign_val ("signature", "sign", signature_dfl);
	  assign_val ("realname", "real", realname_dfl);
	  assign_val ("replyto", "r_to", replyto_dfl);
          assign_val ("organization", "org", organization_dfl);
          assign_val ("signoff_string", "sig_s", signoffstring_dfl);
	  assign_val ("followup_string", "fol_s", followupstring_dfl);
	  assign_val ("custom_headers", "cus_h", customheaders_dfl);
	  assign_val ("followup_custom_headers", "fol_ch", followupcustomheaders_dfl);
	  assign_val ("reply_custom_headers", "rep_ch", replycustomheaders_dfl);
	  assign_val ("reply_string", "rep_s", replystring_dfl);
	  
	  return;
	}
    }
  
  % no identity found, set default values and reset the current ID.
  assign_default ();
  Current_ID = "";
} %}}}

static define view () %{{{
{
  variable id;
  
  if (is_group_mode ())
    error (_function_name () + "does\'t work in group mode");

  id = sprintf ("From: %s <%s@%s>\n" +
		"Reply-To: %s\n"     +
		"Organization: %s\n" +
		"Signoff: %s\n"      +
		"Signature: %s\n"    +
		"F/up string: %s\n"  +
		"Reply string: %s\n" +
		"Headers\n"          +
		"  Custom: %s\n"     +
		"  Followup: %s\n"   +
		"  Reply: %s"        ,
		get_variable_value ("realname"),
		get_variable_value ("username"), get_variable_value ("hostname"),
		get_variable_value ("replyto"),
		get_variable_value ("organization"),
		make_printable_string (get_variable_value ("signoff_string")),
		get_variable_value ("signature"),
		make_printable_string (get_variable_value ("followup_string")),
		make_printable_string (get_variable_value ("reply_string")),
		get_variable_value ("custom_headers"),
		get_variable_value ("followup_custom_headers"),
		get_variable_value ("reply_custom_headers"));
		
  if (("" != Current_ID) and (assoc_key_exists (Identity, Current_ID)))
    {
      id = sprintf ("%s\n" +
                    "Current ID: %s\n" +
		    "Matching RE: %s",
		    id,
		    Current_ID,
		    Identity[Current_ID]["regx"]);
    }
    
  popup_window (sprintf ("Identity on %s:", current_newsgroup ()), id);
} %}}}

% Default key assignment %{{{
definekey ("identity->view", "\eI", "article");
%}}}

% Register hooks %{{{
!if (1 == register_hook ("startup_hook", "identity->retrieve_default"))
  error ("identity.sl: register_hook (startup_hook)");

!if (1 == register_hook ("article_mode_hook", "identity->assign"))
  error ("identity.sl: register hook (article_mode_hook)");

!if (1 == register_hook ("post_hook", "identity->assign"))
  error ("identity.sl: register_hook (post_hook)");

!if (1 == register_hook ("followup_hook", "identity->assign"))
  error ("identity.sl: register_hook (followup_hook)");
  
%}}}

-- 
Best Regards, Keith 
http://kilowatt-radio.org/ NW Oregon Radio Page
Keep Dubya in Office, Vote for Ralph Nader
Re: [slrn]-different signatures for each group
#150449
Author: Keith
Date: Mon, 21 Jun 2004 19:35
47 lines
2622 bytes
Scott Eberl <scott@airea420.com> wrote:
> Is there a way to have multiple .signature files for slrn and based on
> the newsgroup your posting to use that signature file accordingly?


and the id_list.sl

%identity->add_new ("id", "newsgroup");
%identity->set_from ("id", "username", "hostname");
%identity->set_real ("id", "realname");
%identity->set_replyto ("id", "reply-to");
%identity->set_signature ("id", "/path/to/.signature");
%identity->set_regex ("id", "regular expression");
%identity->set_signoffstring ("id", "signoff_string");
%identity->set_followupstring ("id", "followup_string");
%identity->set_replystring ("id", "reply_string");
%identity->set_customheaders ("id", "custom_headers");
%identity->set_followupcustomheaders ("id", "followup_custom_headers");
%identity->set_replycustomheaders ("id", "reply_custom_headers");

%id
% A univoque name, identifying the Identity you created
%newsgroup
% A newsgroup name, or a regular expression matching more groups
%username
% The username part of your email address
%hostname
% The hostname part of your email address
%realname
% Your real name
%reply-to
% The email address you want the other to use when replying to your articles
%/path/to/.signature
% The complete path to the signature file you want to use
%signoff_string
% A signoff string like "Bye,\n Emmanuele.\n"
%followup_string
% A followup string like "On %d, %f wrote:\n"
%reply_string
% Same as above, but for mail replies*
%custom_headers
% User defined headers, for posts, followups and replies

-- 
Best Regards, Keith 
http://kilowatt-radio.org/ NW Oregon Radio Page
Keep Dubya in Office, Vote for Ralph Nader
Re: [slrn]-different signatures for each group
#150452
Author: Michael Prokop
Date: Mon, 21 Jun 2004 19:50
24 lines
2158 bytes
* Scott Eberl <scott@airea420.com> wrote:
> Is there a way to have multiple .signature files for slrn and based on
> the newsgroup your posting to use that signature file accordingly?

Yes.

You are searching for the identity­slang-macro[1].

"Identity is a macro that enables the creation of multiple identities
based upon which Usenet group you're reading or posting to. An
identity consists of many configuration options: from the Realname
to the Signature, to the custom headers."

  -- http://www.emmanuelebassi.net/slrn/

[1] http://www.emmanuelebassi.net/slrn/identity.sl

HTH && best regards,
-mika-
-- 
Patches for the newsreader slrn (www.slrn.org):
* longoptions-patch -> extended help (via --help) and long option-names
* separator-patch   -> _underlined_, *bold*, /italic/ and -separator- text
Available on: http://www.michael-prokop.at/slrn/
Re: [slrn]-different signatures for each group
#150453
Author: Emmanuele Bassi
Date: Mon, 21 Jun 2004 19:57
15 lines
1849 bytes
* 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

Bye,
 Emmanuele.

-- 
Emmanuele Bassi                    [ http://www.emmanuelebassi.net/slrn/ ]
GnuPG Key fingerprint = 4DD0 C90D 4070 F071 5738  08BD 8ECC DB8F A432 0FF4
Re: [slrn]-different signatures for each group
#150458
Author: Scott Eberl
Date: Mon, 21 Jun 2004 21:19
25 lines
2081 bytes
On 2004-06-21, Michael Prokop <devnull@michael-prokop.at> wrote:
> * Scott Eberl <scott@airea420.com> wrote:
>> Is there a way to have multiple .signature files for slrn and based on
>> the newsgroup your posting to use that signature file accordingly?
>
> Yes.
> 
> You are searching for the identity­slang-macro[1].
>
> "Identity is a macro that enables the creation of multiple identities
> based upon which Usenet group you're reading or posting to. An
> identity consists of many configuration options: from the Realname
> to the Signature, to the custom headers."
>
>   -- http://www.emmanuelebassi.net/slrn/
>
> [1] http://www.emmanuelebassi.net/slrn/identity.sl
>
> HTH && best regards,
> -mika-

Why did this message only show up as a bunch of lower case x's when I
tried to read it but it looked just fine when I did a followup to ask
why it looked weird? It said something about spoilers but the ? doesn't
ßhow anything about it.
Re: [slrn]-different signatures for each group
#150459
Author: Michael Prokop
Date: Mon, 21 Jun 2004 21:52
28 lines
2439 bytes
* Scott Eberl <scott@airea420.com> wrote:
> On 2004-06-21, Michael Prokop <devnull@michael-prokop.at> wrote:
>> * Scott Eberl <scott@airea420.com> wrote:
>>> Is there a way to have multiple .signature files for slrn and based on
>>> the newsgroup your posting to use that signature file accordingly?

>> Yes.
[snip spoiler]

[...]

> Why did this message only show up as a bunch of lower case x's when I
> tried to read it but it looked just fine when I did a followup to ask
> why it looked weird? It said something about spoilers but the ? doesn't
> ßhow anything about it.

I was using a spoiler ("^L" -> form-feed, 0x0C, Control-L) -> just
press <SPACE> and you will see the text "behind" ;-)

See e.g. http://www.newsreaders.com/spoilers/

HTH && best regards,
-mika-
-- 
Patches for the newsreader slrn (www.slrn.org):
* longoptions-patch -> extended help (via --help) and long option-names
* separator-patch   -> _underlined_, *bold*, /italic/ and -separator- text
Available on: http://www.michael-prokop.at/slrn/
[OT] * (was: [slrn]-different signatures for each group)
#150473
Author: paf le chien
Date: Tue, 22 Jun 2004 02:16
21 lines
1810 bytes
Hello,

I am sorry for this completely off-topic question but, I am new to slrn
and there is something I really wonder about.
Your message first appeared... erm... well here is a screenshot
http://algazelle.free.fr/slrn.png

as I just pressed SPACE it appeared normally

I just would like to know if this quite weird thing is deliberate or
just some funny behaviour (I don't think so)

I am just curious, sorry :-)
I used xnews for years and years and never saw that before on usenet

would you please tell me, if you don't mind, and if it is your fact?

many thanks :-)

-- 
paf le chien
[OT] * (was: [slrn]-different signatures for each group)
#150472
Author: paf le chien
Date: Tue, 22 Jun 2004 02:18
21 lines
1768 bytes
Hello,

I am sorry for this completely off-topic question but, I am new to slrn
and there is something I really wonder about.
Your message first appeared... erm... well here is a screenshot
http://algazelle.free.fr/slrn.png

as I just pressed SPACE it appeared normally

I just would like to know if this quite weird thing is deliberate or
just some funny behaviour (I don't think so)

I am just curious, sorry :-)
I used xnews for years and years and never saw that before on usenet

would you please tell me, if you don't mind, and if it is your fact?

many thanks :-)

-- 
paf le chien
Re: [OT] * (was: [slrn]-different signatures for each group)
#150479
Author: Blinky the Shark
Date: Tue, 22 Jun 2004 06:21
27 lines
2285 bytes
paf le chien wrote:

> I am sorry for this completely off-topic question but, I am new to
> slrn and there is something I really wonder about.  Your message first
> appeared... erm... well here is a screenshot
> http://algazelle.free.fr/slrn.png

> as I just pressed SPACE it appeared normally

> I just would like to know if this quite weird thing is deliberate or
> just some funny behaviour (I don't think so)

It's called a "spoiler", and it's used kind of like ROT13, to require
that the reader do some action to make it appear in decoded form. This
is often used, in, say a movies group, when what someone's posting would
gave away a movie's twist or surprise or ending, as a courtesy to those
who *dont'* want to see it.  Those who do wish to read it can decode it
(as you did, and as [Esc]+? does with slrn); those who don't wish to
aren't exposed to it by default.

The [Ctrl]-L you see just before the encoding is what triggered it.

-- 
Blinky				        Linux Registered User 297263
AOL Diary		                http://snipurl.com/aoldiary
Nigerian Scam From Space                http://snipurl.com/iss419
New Windows - Don't Wait For Longhorn!  http://snipurl.com/newwin 
Re: [OT] * (was: [slrn]-different signatures for each group)
#150485
Author: paf le chien
Date: Tue, 22 Jun 2004 10:47
28 lines
2302 bytes
Blinky the Shark:
 
> It's called a "spoiler", and it's used kind of like ROT13, to require
> that the reader do some action to make it appear in decoded form. This
> is often used, in, say a movies group, when what someone's posting would
> gave away a movie's twist or surprise or ending, as a courtesy to those
> who *dont'* want to see it.  Those who do wish to read it can decode it
> (as you did, and as [Esc]+? does with slrn); those who don't wish to
> aren't exposed to it by default.
> 
> The [Ctrl]-L you see just before the encoding is what triggered it.
 
argh :-(

thanks Blinky The Shark, I am sorry that this post is still here.
I cancelled it but, a bit late unfortunately, my newsserver doesn't
support cancels, and I guess it got caught by some feeds before I
connected to another one and this second got my article.

I looked too late further in the thread, too bad, same question juste
before. And then I looked at the relevant part of the slrn-FAQ and got
it explained

sorry again

-- 
paf le chien
remove the primate to reply
Re: [OT] * (was: [slrn]-different signatures for each group)
#150504
Author: Blinky the Shark
Date: Tue, 22 Jun 2004 19:26
37 lines
2708 bytes
paf le chien wrote:

> Blinky the Shark:

>> It's called a "spoiler", and it's used kind of like ROT13, to require
>> that the reader do some action to make it appear in decoded form. This
>> is often used, in, say a movies group, when what someone's posting would
>> gave away a movie's twist or surprise or ending, as a courtesy to those
>> who *dont'* want to see it.  Those who do wish to read it can decode it
>> (as you did, and as [Esc]+? does with slrn); those who don't wish to
>> aren't exposed to it by default.

>> The [Ctrl]-L you see just before the encoding is what triggered it.

> argh :-(

> thanks Blinky The Shark, I am sorry that this post is still here.
> I cancelled it but, a bit late unfortunately, my newsserver doesn't
> support cancels, and I guess it got caught by some feeds before I
> connected to another one and this second got my article.

Doesn't matter if your client supports cancels or not.  Most servers
don't respect cancels.

> I looked too late further in the thread, too bad, same question juste
> before. And then I looked at the relevant part of the slrn-FAQ and got
> it explained

> sorry again

No problem.

-- 
Blinky				        Linux Registered User 297263
AOL Diary		                http://snipurl.com/aoldiary
Nigerian Scam From Space                http://snipurl.com/iss419
New Windows - Don't Wait For Longhorn!  http://snipurl.com/newwin 
Re: [slrn]-different signatures for each group
#150631
Author: 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
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