]> git.deb.at Git - pkg/t-prot.git/blobdiff - contrib/t-prot.sl
finalize
[pkg/t-prot.git] / contrib / t-prot.sl
index 8d8431f8193f0bc5c203bac28f7aa1cd4c8d5e61..597f2f17096d2ff6211dfe7035675188236908b1 100644 (file)
@@ -1,4 +1,4 @@
-% $Id: t-prot.sl,v 1.16 2005/05/10 13:09:06 jochen Exp $
+% $Id: t-prot.sl,v 1.20 2012/02/07 11:19:57 jochen Exp $
 % Copyright (c) 2003-2005 Jochen Striepe <t-prot@tolot.escape.de>
 %
 % This file is provided as an example implemention for articles to be
@@ -12,7 +12,7 @@
 %
 % If you are not happy with the suggested t-prot default parameters,
 % put something like
-%   variable t_prot_params = "-cemtS";
+%   variable t_prot_params = "-c -emtS";
 %   variable t_prot_tmpdir = "$HOME/.tmpdir";
 %   variable t_prot_qp     = "";
 % into ~/.slrn/t-prot-cfg and add
@@ -40,9 +40,9 @@
 % on any Unix-like system, mktemp(1) should be available on any recent
 % OpenBSD or Debian Linux system -- you can get the sources there
 % if your system happens to lack this program. This macro has been
-% tested with slrn-0.9.7.4 to slrn-0.9.8.0 and S-Lang v1.4.5, it might
-% fail with other versions. As always, bug reports, patches (preferrably
-% in unified diff format), comments and suggestions are welcome.
+% written for S-Lang v2.x (and will definitely fail with S-Lang v1.x).
+% As always, bug reports, patches (preferrably in unified diff format),
+% comments and suggestions are welcome.
 %
 % License: This file is part of the t-prot package and therefore
 % available under the same conditions. See t-prot's man page for
@@ -50,7 +50,7 @@
 
 
 % these should be reasonable defaults (they work fine for me, SCNR):
-variable t_prot_params = "-aceklmtS --diff --bigq -L$HOME/.slrn/mlfooters -A$HOME/.slrn/adfooters";
+variable t_prot_params = "-aeklmtc -S --diff --bigq -L$HOME/.slrn/mlfooters -A$HOME/.slrn/adfooters";
 variable t_prot_tmpdir = "$HOME/tmp/slrn"; % you better make sure it exists
 variable t_prot_qp = "perl -i -p -e '$p=1 if /^Content-Transfer-Encoding: quoted-printable/i; if ($p==1) { s/=([0-9a-f][0-9a-f])/chr(hex($1))/egi; s/=\n//eg; };'";
 
@@ -71,7 +71,7 @@ define t_prot () {
 
        f = popen (qp+"t-prot "+t_prot_params+" >"+fname, "w");
        if (f == NULL) {
-               error ("Unable to filter article to "+fname);
+               message ("Unable to filter article to "+fname);
                return;
        }
        () = fputs (article_as_string(), f);
@@ -80,7 +80,7 @@ define t_prot () {
 
        f = fopen (fname, "r");
        if (f == NULL) {
-               error (fname+" could not be opened.");
+               message (fname+" could not be opened.");
                return;
        }
        while (-1 != fgets (&line, f)) {
@@ -88,26 +88,26 @@ define t_prot () {
        }
        fclose (f);
 
-       if (0 != remove(fname)) error ("Unable to remove "+fname);
+       if (0 != remove(fname)) message ("Unable to remove "+fname);
 
        replace_article (art);
 }
 
 define register_t_prot () {
        if (1 == register_hook("read_article_hook", "t_prot")) {
-               error("t-prot filtering activated");
+               message ("t-prot filtering activated");
        }
        else {
-               error("t-prot filtering NOT activated");
+               message ("t-prot filtering NOT activated");
        }
 }
 
 define unregister_t_prot () {
        if (1 == unregister_hook("read_article_hook", "t_prot")) {
-               error("t-prot filtering deactivated");
+               message ("t-prot filtering deactivated");
        }
        else {
-               error("t-prot filtering NOT deactivated");
+               message ("t-prot filtering NOT deactivated");
        }
 }