Package: t-prot
Version: 1.49-1
Severity: wishlist
Tags: patch
Some suggestions for improving t-prot.sl:
* Assigning ESC-1 and ESC-0 (for de/activating t-prot filtering in slrn) is
IMO no good idea because slrn often uses these shortcuts as prefix
arguments. I use ESC-6 und ESC-7 because the seem unused.
* If mimedecode is installed it seems to do a better job for decoding
quoted-printable encodings (i.e. it decodes the headers correctly) than
the perl command; it might be a suggestion for the user to set
'variable t_prot_qp = "mimedecode";'.
* The flickering screen on each call to t-prot (caused by pipe_article() and
system()) is annoying; these functions can be replaced by a popen/fputs
construct and a remove() call respectivly.
All above mentioned suggestions are included in the attached patch.
gregor
-- System Information:
Debian Release: 3.1
APT prefers testing
APT policy: (990, 'testing'), (10, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.10.200503251646
Locale: LANG=C, [EMAIL PROTECTED] (charmap=ISO-8859-15)
Versions of packages t-prot depends on:
ii debconf 1.4.30.11 Debian configuration management sy
ii libgetopt-mixed-perl 1.008-10 Perl module for processing options
ii perl 5.8.4-8 Larry Wall's Practical Extraction
-- no debconf information
--- /usr/share/slrn/macros/t-prot.sl.orig 2005-03-27 13:53:44.025537936
+0200
+++ /usr/share/slrn/macros/t-prot.sl 2005-03-27 14:25:15.863813080 +0200
@@ -19,7 +19,9 @@
% interpret .slrn/t-prot-cfg
-% to your ~/.slrnrc (after 'interpret t-prot.sl'). However, please keep
-% in mind that the path of the temp directory should NOT be readable to
-% other users -- otherwise it might reveal information on what you read,
-% and probably even be a security hole.
-% Please see t-prot's man page for details on command line parameters.
+% to your ~/.slrnrc (after 'interpret t-prot.sl'). If "mimedecode" is
+% installed on your system you might want to use
+% variable t_prot_qp = "mimedecode";
+% However, please keep in mind that the path of the temp directory should
+% NOT be readable to other users -- otherwise it might reveal information on
+% what you read, and probably even be a security hole. Please see t-prot's
+% man page for details on command line parameters.
%
@@ -27,6 +29,6 @@
% you may want to add something like
-% setkey article register_t_prot "\e1"
-% setkey article unregister_t_prot "\e0"
-% to your ~/.slrnrc -- press ESC-1 to activate t-prot filtering, and
-% ESC-0 to disable it (this will take effect on the next article you
+% setkey article register_t_prot "\e6"
+% setkey article unregister_t_prot "\e7"
+% to your ~/.slrnrc -- press ESC-6 to activate t-prot filtering, and
+% ESC-7 to disable it (this will take effect on the next article you
% read, see the package's TODO file).
@@ -65,3 +67,11 @@
if (t_prot_qp != "") { qp = t_prot_qp+"|"; } else { qp = ""; }
- pipe_article (qp+"t-prot "+t_prot_params+" >"+fname);
+
+ f = popen (qp+"t-prot "+t_prot_params+" >"+fname, "w");
+ if (f == NULL) {
+ error ("Unable to filter article to "+fname);
+ return;
+ }
+ () = fputs (article_as_string(), f);
+ () = pclose (f);
+
@@ -77,5 +87,4 @@
- % The removal of the tmp file works this way but should be made a
- % little more reliable. Any ideas?
- system ("rm -f "+fname);
+ if (0 != remove(fname)) error ("Unable to remove "+fname);
+
replace_article (art);