Thread View: news.software.readers
6 messages
6 total messages
Started by Remco Gerlich
Wed, 26 May 1999 00:00
[slrn] Random sigs again
Author: Remco Gerlich
Date: Wed, 26 May 1999 00:00
Date: Wed, 26 May 1999 00:00
18 lines
1274 bytes
1274 bytes
I want to include random signatures in my posts with slrn 0952 (will upgrade soon). Using DejaNews I found the nice solution with set editor "getsig >.sigfile; emacs", etc. However, I want the signature to depend on the newsgroup(s) I'm posting to, like Dutch sigs only in Dutch groups, Angband related quotes only to the Angband group, etc. Is there a way I can pass the newsgroups line to the script? Otherwise, I could have the script edit the signature after editing the file - just replace $$SIG$$ with the signature. In that case, the script would have to know the filename of the post, though. How to do that? TIA -- Remco Gerlich scarblac (a) pino.selwerd.cx
Re: [slrn] Random sigs again
Author: Jens Wahnes
Date: Wed, 26 May 1999 00:00
Date: Wed, 26 May 1999 00:00
57 lines
2724 bytes
2724 bytes
Remco Gerlich wrote:
> I want to include random signatures in my posts with slrn 0952
> (will upgrade soon). Using DejaNews I found the nice solution
> with set editor "getsig >.sigfile; emacs", etc. However, I want
> the signature to depend on the newsgroup(s) I'm posting to,
> like Dutch sigs only in Dutch groups, Angband related quotes
> only to the Angband group, etc.
A while ago, somebody posted code for a s-lang macro to set the
signature depending on the name of the newsgroup. I can't find the
original article so I'm afraid I cannot give credit for this. Here
is my slightly extended version of the macro:
define article_mode_hook ()
{
variable signature_file = ".signature-eng"; % english signature
variable reply_s = "In %n, you wrote:\n"; %etc
variable cc_fup_s = "[This messages has also been posted to a newsgroup]\n";
variable followup_s = "%r wrote:\n";
variable newsgroup = current_newsgroup ();
if (orelse
{ string_match (newsgroup, "^de\.", 1) }
{ string_match (newsgroup, "^kl\.", 1) }
{ string_match (newsgroup, "^schule\.", 1) }
{ string_match (newsgroup, "^local\.test\.", 1) })
{
signature_file = ".signature"; % german signature
followup_s = "%r schrieb am %d folgendes:\n";
reply_s = "Hallo %r,\nDu schriebst am %d in %n:\n";
cc_fup_s = "[Dies ist die Kopie eines Artikels, der in eine Newsgruppe gepostet wurde]";
}
set_string_variable ("signature", signature_file);
set_string_variable ("followup_string", followup_s);
set_string_variable ("cc_followup_string", cc_fup_s);
set_string_variable ("reply_string", reply_s);
}
If you change the command that is executed before calling the editor
in such a way that it changes all signature files, this might work.
Maybe somebody else has an easier solution for this?
Jens
--
"What is robbing a bank compared with founding a bank?"
- Bertolt Brecht
Re: [slrn] Random sigs again
Author: John E. Davis
Date: Thu, 27 May 1999 00:00
Date: Thu, 27 May 1999 00:00
21 lines
1432 bytes
1432 bytes
On 27 May 1999 15:18:38 GMT, Heikki Kantola <hezu@iki.fi>
wrote:
>one could use $RANDOM if using zsh or bash) or write native rand()-
>function for S-Lang as there isn't one yet.
If I add a random number generator, I may add a simple one such as:
static variable R = 1UL;
define random ()
{
R = R * 69069UL + 1013904243UL;
return R/4294967296.0;
}
define srandom (x)
{
R = x;
}
--John
Re: [slrn] Random sigs again
Author: Heikki Kantola
Date: Thu, 27 May 1999 00:00
Date: Thu, 27 May 1999 00:00
35 lines
2367 bytes
2367 bytes
Remco Gerlich <scarblac-spamtrap@pino.selwerd.cx> informed news.software.readers with the following: >Jens Wahnes <jewa@gmx.net> wrote: >> If you change the command that is executed before calling the editor >> in such a way that it changes all signature files, this might work. >> Maybe somebody else has an easier solution for this? For randomizing signatures (or something else), I can think two possible solutions: 1) propably easier one, which doesn't however work if you've home dir on NFS device, would propably be using program that controls named pipe from which you could read random signatures. There's already some such programs available, although I can't find details of any just now. 2) You could somehow do the random picking within S-Lang too as long as you can somehow get random numbers from external source (I think one could use $RANDOM if using zsh or bash) or write native rand()- function for S-Lang as there isn't one yet. [Description of hacking deleted] >This is fun :-) > >It almost works. If this is interesting, I'll post it here >(or you can mail me). > >(next small hack: make ispell ignore headers, especially "message-id"). Check out newsbody, <URL:http://www.image.dk/%7Ebyrial/newsbody/>. -- Heikki "Hezu" Kantola, <Heikki.Kantola@IKI.FI> L�hett�m�ll� mainoksia tai muuta asiatonta s�hk�postia yll� olevaan osoitteeseen sitoudut maksamaan oikolukupalvelusta FIM500 alkavalta tunnilta.
Re: [slrn] Random sigs again
Author: Remco Gerlich
Date: Thu, 27 May 1999 00:00
Date: Thu, 27 May 1999 00:00
34 lines
2076 bytes
2076 bytes
Jens Wahnes <jewa@gmx.net> wrote:
> If you change the command that is executed before calling the editor
> in such a way that it changes all signature files, this might work.
> Maybe somebody else has an easier solution for this?
I've been hacking myself now. The sig file script is called after
the editor, with the same argument ('%s') as the editor. Then it
scans the file for the Newsgroups: line.
It will then take a signature file from a list; they can have
a Perl regexp (say /^nl\./ for Dutch groups) and all the newsgroups
the post goes to have to match the regexp. If it doesn't work,
try another one (and it fails after some tries).
Also added an inline command for choosing a specific signature
file in the editor, or choosing a random one that holds a specific
text (like '&SIG "elephant"' to pick a random one with the word
elephant...)
Now, it also checks if a signature file is executable, in which
case it's executed, and the output is used as the signature (so I can
add things like amount of users right now, or the level of my
current Angband character).
This is fun :-)
It almost works. If this is interesting, I'll post it here
(or you can mail me).
(next small hack: make ispell ignore headers, especially "message-id").
--
Remco Gerlich, scarblac@pino.selwerd.cx
Re: [slrn] Random sigs again
Author: Remco Gerlich
Date: Thu, 27 May 1999 00:00
Date: Thu, 27 May 1999 00:00
12 lines
1131 bytes
1131 bytes
Heikki Kantola <hezu@iki.fi> wrote: > >(next small hack: make ispell ignore headers, especially "message-id"). > > Check out newsbody, <URL:http://www.image.dk/%7Ebyrial/newsbody/>. Thanks! Exactly what I was looking for. -- Remco Gerlich, scarblac@pino.selwerd.cx
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