On Wed, Jun 26, 2002 at 11:27:03AM -0500, David T-G wrote:
> Gary, et al --
> 
> ...and then Gary Johnson said...
> % 
> % On Wed, Jun 26, 2002 at 02:17:53PM +0200, Cedric Duval wrote:
> % > Pedro Alves wrote:
> % > > Hello. Is it possible to configure mutt to automatically lunch the external
> % > > viewer defined in mailcap inside the mutt window? For instance, lunch w3m
> ...
> % >    auto_view text/html
> ...
> % Pedro wanted was to view the HTML content of the message using a browser
> % such as w3m, as can be done from the attachment menu, but with the
> % browser invoked automatically when the message is opened from the index
> % menu.  I don't think mutt currently supports that.
> 
> In that case, what about something like
> 
>   msg-hook .  'set pager=builtin'
>   msg-hook <pattern> 'set pager=lynx'
> 
> or so?  If you want lynx as a pager, just set lynx as the pager...
> [Note that this is untested, that I don't use msg-hook, and that
> there's probably a lovely default setting that might be better than 
> the all-matching default msg-hook.]

Good point.  You just have to see that mutt sends raw HTML to the pager.
You also reminded me of a similar discussion here last month in which I
wrote:

> I played around with this a little and came up with the following
> solution.  It may have some bugs, but it's at least a starting point.
> First of all, you want to have mutt send HTML messages as raw HTML to
> your pager.  The way I did this was to put this in my muttrc:
>
>     auto_view text/html
>
> and this in my mailcap:
>
>     text/html; w3m %s; nametemplate=%s.html
>     text/html; cat; copiousoutput
>
> Next, you want to specify a pager that understands that the header is
> plain text but the body is HTML.  I wrote a shell script and called it
> 'htmlviewer':
>
>     #!/bin/sh
>     sed '1i\
>     <html>\
>     <head>\
>     <title></title>\
>     </head>\
>     <body>\
>     <pre>
>     s|^\[-- Autoview using .*|</pre>\
>     </body>\
>     </html>|
>     ' $* | w3m -T text/html
>
> It wraps the header in an HTML block and deletes the "[-- Autoview" line
> before sending the message to w3m.  Then I just set
>
>     pager=htmlviewer
>
> in my muttrc.  You will probably want to use a display-hook (or
> message-hook) for this.

I don't know why I didn't think of that when I wrote my first reply.

Gary

-- 
Gary Johnson                               | Agilent Technologies
[EMAIL PROTECTED]                   | Spokane, Washington, USA
http://www.spocom.com/users/gjohnson/mutt/ |

Reply via email to