Piet, et al --
...and then Piet Delport said...
% On Wed, 19 Sep 2001 at 15:09:32 -0400, David T-G wrote:
% > ...and then David Champion said...
% [snip]
% > % Guess someone just can't make up their minds. I wonder whether it's
% > % Sun or a standards agency. I wish I still had other platforms....
% >
% > Yeah.
%
% Well, FreeBSD has the following to say under tr(1):
[snip]
Oooh; details! Thanks so much; that's helpful and kind of brings things
together.
% (hope the URL gets through intact) ]
It did; thanks.
%
% So, under the POSIX standard at least (and *BSD, in this case), the One
% True Way is:
%
% tr A-Za-z N-ZA-Mn-za-m
%
% Does that work under Solaris?
I'm sure it does under 2.6 and 8, and almost sure for 2.x* for 2<x<6, if
it's quoted; I'm not sure about the naked version exactly as you have it.
%
% > % Well, the lesson is that tr usage varies wildly among platforms,
% > % just like expr, but we already knew that. :)
%
% That's what POSIX tries to remedy. :)
Yep :_)
%
% > % So maybe it's best just to have your .mailcap call that rot13 shell
% > % script, and adapt the script to cope with unames appropriately. Or
% > % use perl.
% >
% > sh is portable (see other drifted-off-topic thread :-) but with this
% > much garbage rolled in I think I will, indeed, go for perl.
%
% Heavens man, have you no concern for efficiency? :-) If the POSIX
But perl is *fun*!
% version doesn't work under Solaris, i'd rather go for:
%
% tr ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz \
% NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm
%
% Much more lightweight, and should work practically anywhere, even if
% it involves a bit of extra typing.
Only once, though, so typing isn't the problem. No, this is guaranteed
to work everywhere.
%
% Also, as for getting mutt to actually use the filter, i'm surprised no
% one has pointed at $display_filter yet.
Um, what's that? Off to read the man pages...
%
% Instead of resorting to hacks involving .mailcap and (horrors :-) editing
% the message's content type[1], you can just do something like:
%
% macro pager ( "<enter-command>set display_filter=\n<enter-command>macro pager \\ca
)\n<display-toggle-weed><display-toggle-weed>"
% macro pager ) "<enter-command>set display_filter=rot13\n<enter-command>macro pager
\\ca (\n<display-toggle-weed><display-toggle-weed>"
% macro pager \ca ) "Toggle ROT13 decoding"
%
% (Pity there's no way to force mutt to re-parse the message... i'm using
% a double <display-toggle-weed> to simulate one.)
Nice trick.
%
% Just replace `rot13' with your chosen filter command and you're set; no
% extra config required, and no risk of munging actual messages.
Excellent! I'll change \ca to \cx (an old rn man :-) and be set, it
seems.
%
%
% [1] What happens if the message you're rot'ing is something besides
% text/plain, like text/html f'rinstance? The given macro will just
% nuke the content-type from orbit, leaving you looking at HTML
% source.
I had worried about that myself, but figured I'd limit this functionality
to text-only messages and be happy I had it at all :-) I also haven't
yet read Vineet's method for multipart mails but figured that it might
take care of that concern...
%
% --
% Piet Delport <[EMAIL PROTECTED]>
% Today's subliminal thought is:
:-D
--
David T-G * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
PGP signature