The page contains a few S-Lang macros for the slrn newsreader and the jed
text editor. If you notice a bug or have some comments, suggestions for improvement, etc,
let me know ;-)
I add news macros and improve the old ones from time to time; see the changelog. Just for the record: I use s-lang 1.4.6, slrn 0.9.7.4+ and jed 0.99.16 |
CONTENTS:
Subject: Sv: Hi! --> Subject: Re: Hi!
Subject: Odp: Odp: Cześć! --> Subject: Re: Cześć!
Subject: Re: Sv: Odp: Odp: Odp: Hej! --> Subject: Re: Hej!
The following two macros do the same; use whichever.
Well, if you're into vi, you have to use the second one :)
Download the macro for jed: jsv2re.txt
Download the macro for slrn: sv2re.txt
Download the macro: sigrot.zip
Download the macro: pgpsign.txt
Download the macro: encoding.txt
Download the macro: savex.txt
Download the macro: msgid.txt
NOTE: a more functional macro performing the same tasks is
available
from the slrn-pl CVS repository [howto]
>> Once upon a time there were three little
foxes
>> Who didn't wear stockings and who didn't wear
sockses
becomes
>> Once upon a time there were three little
>> foxes
>> Who didn't wear stockings and who didn't wear
>> sockses
or, depending on your settings,
>> Once upon a time there were three little foxes
>> Who didn't wear stockings and who didn't wear sockses
The macro can be executed automatically, but, as the conversion is not always perfect,
it is safer to call it manually. Standard binding: META-q.
X-File: /path/to/the/file
Download the macro: untaball.txt
Download the macro: headers.txt
Download the macro: multi.txt
NOTE: forget it! There's a real macro performing this task way
better. Get it
from the author's
page or from
the slrn-pl CVS repository [howto]
Sure it doesn't make sense to replace all occurences of an "a" with a
"z" -- that's just to show how one does it. As an example you can
download a macro using this method to convert
QP-> 8bit, (pl) UNICODE-> (pl)iso, La/Te/X-> iso-8859-2, uhtml, etc
into the local (plain text) charset. Conversion type is chosen from a menu.
define konwertuj ()
{
variable article = article_as_string ();
while (str_replace (article,"a","z")) article = ();
while (str_replace (article,"x","d")) article = ();
replace_article (article);
}
% --- end here ----------------------------------------
Such a conversion can also be triggered automatically based on the charset declaration in article headers; look at the following hook:
(note that in newer versions of slrn it is better to
turn the above into a function and then bind it to a hook via the
register_hook() function)
define read_article_hook ()
{
variable xcharset = extract_displayed_article_header("Content-Type");
if (string_match(xcharset,"charset=\"?utf-7\"?",1)){utf72iso();}
% [...] etc, etc, you can put a lot here
}
In fact, much more can be achieved with such conversions: have a look
at the "poor man's mime" macro.
Download the macro: wywal_ms_siga.txt
Download the macro: uhtml.txt
SLRNSTAT:
Brzezi <brzezi @ enter.net.pl> wrote a small program generating nice
statistics from the .slrn_post_log file:
See an example output of the program. --
Download the program (source + binary)
Download the macro: de_spy.txt
See how it looks: colorset.gif
* download 30 colour schemes
download a perl script checking if the colour sets you use are complete
Download the macro: ext_header.txt
Download the macro for slrn 0.9.6.4 or older: raw_old.txt
Download the macro for slrn 0.9.6.4pl4/0.9.7.0 or newer: raw.txt
This is a multi-part message in MIME format. ------=_NextPart_000_0185_01BFC683.16E40180 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit ĹťyczÄ krĂłtkiego oglÄ dania i genialnych przemyĹleĹ ! :-))) ------=_NextPart_000_0185_01BFC683.16E40180 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> [...] </BODY></HTML> ------=_NextPart_000_0185_01BFC683.16E40180-- |
Życzę krótkiego oglądania i genialnych przemyśleń ! :-))) [ Multipart MIME message successfully processed. v0.01 (slrn) ] [ HTML part removed. UTF conv. to iso-8859-2. ] |
Quite a difference, isn't it? :-) The macro also deals with UFT messages,
X-CHARSET UNKNOWN QP messages, PGP/MIME signatures, vcards, html, etc. (And you can
always see how it originally looked like with this macro.)
Charset conversion macro
is required for this to work! [see README/CZYTAJTO]
On 9 Jun 2000 06:25:34 GMT, user <user@d.pl> wrote:you can have eg.
user wrote in news:2w34324532452.23453245.3245@asf.dre.pl on 09.06.2k:Adjust the macro to your needs (don't re-define the followup_hook if you aready have one).
Download the macro for slrn 0.9.6.4 or older: data_old.txt
Download the macro for slrn 0.9.6.4pl4/0.9.7.0 or newer: data.txt
Download the macro: slrn-lock.txt
* COUNTEM/AMIALONE [slrn] - "tsca_func->countem(x)" will give you the number of currently running instances of slrn.
x = 0 --> in general on your system x = 1 --> owned by you ($USER)The function requires `ps` and `grep` in your system and due to the use of popen() won't work in Windows. More info in the macro.
Download the macro: tsca-func.txt
Download the macro: frwd.txt (slrnpull required)
Download the macro: frwd-ham.txt (Hamster required)
More mutations of this macro:
one *
two [howto]
.slrnrc / slrn.rc
% This catches the Supercite-type "TtS> " quotes,
% and _doesn't_ catch lines starting with ":)" smileys
ignore_quotes "^ *[a-zA-Z-]*>" "^ *[\]|)]" "^ *:[^-()^]"
score
If you want to play with your scorefile in an open text editor and see the
results immediately in a running slrn, put
[*]
% This scores my posts and three succesive followups made to them
Score:: 2000
From: tsca@
From: sienicki
Score: 1000
References: tsca@gate\d*\.has\.dk> *$
Score: 900
References: tsca@gate\d*\.has\.dk> *<[^>]*> *$
Score: 500
References: tsca@gate\d*\.has\.dk> *<[^>]*> *<[^>]*> *$
% ... and this catches "s-lang", "slang", and "slrn" :)
Score: 100
Subject: \<s-?l[ar]ng?
[comp.editors]
% We don't want vi, vim & gvim :)
Score: -9999
Subject: \<g?vim?\>
setkey article "reload_scorefile(-1)" "\ek"
in your .slrnrc/slrn.rc. Upon pressing ESC-k the scorefile
will be reloaded and changes will be applied.
Read also some notes on S-Lang regular expressions and see more examples:
in English or in Polish.
other
This little script makes life way easier when you use
slrn with many newsservers. Instead of typing all the data on the command line,
just type nwo server
. Of course you gotta change the data in the script
before using it; add as many newsservers, slrnrc files and options as you wish.
WHY:
As I am one of the slrn-pl developers,
some of these macros are included
in the slrn-pl package and they are developed in our
CVS repository
(thanks to the PLD folks for
the space). The newest versions of the macros are always available from the
repository; there is no use duplicating them here.
HOW:
The macros still can be used with the "vanilla" slrn; the only requirement is
that the system macro
"slrn-pl.sl" must be interpreted before. To get the desired macro click on the
version number (the underlined part of the first line), eg:
1.6 Sat May 4 18:30:35 2002 by tsca CVS Tags: HEAD Diffs to 1.5Hint for OE users: the downloaded files are gzipped; use eg. WinZip or Windows Commander to unpack them. If you still have problems understanding how to download macros from CVS, mail me for assistance.
Get more JED icons. |
|