* Gary Johnson on Tuesday, November 11, 2014 at 07:58:59 -0800
> I use viewhtmlmsg from the muttutils package,
> https://bitbucket.org/blacktrash/muttils.  It opens the message,
> including images, in a browser.
> 
> To make it more convenient to use, I have these macros in my
> ~/.vimrc

That's probably ~/.muttrc ;-)

> which use the shell script shown below.
> 
> # View the message using viewhtmlmsg.
> #
> macro index,pager ,v "\
> <enter-command> set my_pipe_decode=\$pipe_decode my_wait_key=\$wait_key \
> pipe_decode=no wait_key=no<enter>\
> <pipe-message> mutt_viewhtmlmsg -s<enter>\
> <enter-command> set pipe_decode=\$my_pipe_decode wait_key=\$my_wait_key \
> &my_pipe_decode &my_wait_key<enter>\
> " "view HTML (safe) in browser"
> macro index,pager ,V "\
> <enter-command> set my_pipe_decode=\$pipe_decode my_wait_key=\$wait_key \
> pipe_decode=no wait_key=no<enter>\
> <pipe-message> mutt_viewhtmlmsg<enter>\
> <enter-command> set pipe_decode=\$my_pipe_decode wait_key=\$my_wait_key \
> &my_pipe_decode &my_wait_key<enter>\
> " "view HTML (unsafe) in browser"
> 
> ------------------------- mutt_viewhtmlmsg -------------------------
> #!/bin/bash
> tmpfile=$(tempfile) || exit 1
> cat > "$tmpfile"
> export BROWSER=midori
> {
>    viewhtmlmsg "$@" < "$tmpfile" >/dev/null 2>&1
>    rm -f "$tmpfile"
> } &
> --------------------------------------------------------------------

imho you don't need the the shell wrapper, and could instead
adjust the -b and -k options for viewhtmlmsg (YMMV):

$ viewhtmlmsg -h
Usage: viewhtmlmsg [options]

Displays html message read from stdin.  $BROWSER environment may be overridden
with option "-b".

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -s, --safe            view html w/o loading remote files
  -k KEEP, --keep=KEEP  remove temporary files after KEEP seconds (0 for
                        keeping files)
  -b APP, --browser=APP
                        prefer browser APP over $BROWSER environment


-- 
Python Mutt utilities --->>
https://bitbucket.org/blacktrash/muttils
http://www.blacktrash.org/hg/muttils

Reply via email to