* David Champion ([EMAIL PROTECTED]) [010919 10:38]:
> On 2001.09.19, in <[EMAIL PROTECTED]>,
> "Miguel Farah F." <[EMAIL PROTECTED]> wrote:
> > Jura ernqvat arjf jvgu gva, vs bar cerffrf gur 'q' xrl, gur pbagrag bs
> > gur negvpyr orvat ernq jvyy or ebg13-rq.
> >
> > V guvax zhgg pbhyq unir guvf pncnovyvgl, gbb. Jung V qb pheeragyl vf
> > cvcr gur znvy V'z ernqvat gb gur ebg13 pbzznaq va zl ~/ova qverpgbel,
> > ohg vg'f abg nf pbairavrag nf orvat noyr gb qb vg gur gva jnl
>
> How about this?
>
> auto_view text/rot-13
> macro index \Ca
>"<edit-type><kill-line>text/rot-13<enter><display-message><edit-type><kill-line>text/plain<enter>"
> "Display message with ROT-13 encoding"
To use it with PGP (well, PGP/MIME, anyway) or other mime multipart
messages, try this version instead:
macro attach \Ca
"<edit-type><kill-line>text/x-rot13<enter><view-attach><edit-type><kill-line>text/plain<enter>"
"Display message with ROT-13 encoding"
Also, these don't work so well with the builtin pager, because the
display-message or view-attach commands return immediately in that case.
For the internal pager, you may be better off with something like these
2 macros together:
macro pager \Ca "<edit-type><kill-line>text/x-rot13<enter>" "Display message with
ROT-13 encoding"
macro pager \CA "<edit-type><kill-line>text/plain<enter>" "Revert message from ROT-13
back to text/plain"
Does anyone have a better idea of how to make one macro that toggles? Is
there a way to make a "named" macro? Then you could do something like
this:
function1() {
push "<edit-type><kill-line>text/x-rot13<enter>"
macro pager \Ca function2
}
function2() {
push "<edit-type><kill-line>text/plain<enter>"
macro pager \Ca function1
}
I guess you could effect it with "push":(untested)
macro pager \Cb '<edit-type><kill-line>text/x-rot13<enter>macro \Ca "push \CB"'
macro pager \CB '<edit-type><kill-line>text/plain<enter>macro \Ca "push \Cb"'
macro pager \Ca 'push \Cb'
but you 'lose' a couple of keys that way. I suppose you could make them
some inconvenient keybinding that you'd never use anyway, and then you'd
be all right.
all of these 'toggle' methods also break horribly if you rot13 a message
and then don't change it back before you go off and view other messages.
Well, maybe not horribly; you'll just have to hit \Ca a couple of times
until it straightens itself out.
--
Vineet http://www.anti-dmca.org
Unauthorized use of this .sig may constitute violation of US law.
echo Qba\'g gernq ba zr\! |tr 'a-zA-Z' 'n-za-mN-ZA-M'
PGP signature