Piet, et al --

...and then Piet Delport said...
% 
...
% 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.)

Hokay, so I've given this a try and it works -- once.  I can \cx to
rotate and \cx to unrotate but then it stops.  My muttrc has

  macro pager ,@r13on "<enter-command>set 
display_filter=$HOME/local/bin/rot13\n<enter-command>macro pager \\cx 
,@r13off\n<display-toggle-weed><display-toggle-weed>"
  macro pager ,@r13off "<enter-command>set display_filter=\n<enter-command>macro 
pager\\cx ,@r13on\n<display-toggle-weed><display-toggle-weed>"
  macro pager \cx ,@r13on       "Toggle ROT13 decoding"

(yes, with the path hardcoded for the moment) and when I first start mutt
my pager help shows

  Help for pager                                                 -- (42%)
  ...
  ^X          M ,@r13on      Toggle ROT13 decoding
  ...
  ,@r13off    macro          <enter-command>set display_filter=\n<enter-co
  +                          mmand>macro pager\cx ,@r13on\n<display-toggle
  +                          -weed><display-toggle-weed>
  ,@r13on     macro          <enter-command>set display_filter=/home/david
  +                          tg/local/bin/rot13\n<enter-command>macro page
  +                          r \cx ,@r13off\n<display-toggle-weed><display
  +                          -toggle-weed>

and then after a \cX my pager help shows

  Help for pager                                                 -- (41%)
  ...
  ^X          macro          ,@r13off
  ...
  ,@r13off    macro          <enter-command>set display_filter=\n<enter-co
  +                          mmand>macro pager\cx ,@r13on\n<display-toggle
  +                          -weed><display-toggle-weed>
  ,@r13on     macro          <enter-command>set display_filter=/home/david
  +                          tg/local/bin/rot13\n<enter-command>macro page
  +                          r \cx ,@r13off\n<display-toggle-weed><display
  +                          -toggle-weed>

but the tricky part is that after another \cX my pager help still shows

  Help for pager                                                 -- (41%)
  ...
  ^X          macro          ,@r13off
  ...
  ,@r13off    macro          <enter-command>set display_filter=\n<enter-co
  +                          mmand>macro pager\cx ,@r13on\n<display-toggle
  +                          -weed><display-toggle-weed>
  ,@r13on     macro          <enter-command>set display_filter=/home/david
  +                          tg/local/bin/rot13\n<enter-command>macro page
  +                          r \cx ,@r13off\n<display-toggle-weed><display
  +                          -toggle-weed>

and so I can never get back to rot13 mode unless I manually define \cX to
be ,@r13on again.  Can you see why ,@r13off isn't properly resetting \cX?
And why should the columns differ (example one to examples two and three)
and \cX lose its description?

Meanwhile, I think I may have hit on a limit in macro name length; this
didn't work with ,@rot13off so I had to shorten it a bit.  I haven't
looked yet other than briefly at the manual, which didn't mention one,
but does anyone know of a name length limit?


Thanks again, and in advance.

:-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

Reply via email to