<<< Date Index >>>     <<< Thread Index >>>

Re: Viewing HTML messages with images



* Sertaç Ö. Yıldız on Sunday, September 09, 2007 at 00:13:34 +0300
> If you have w3m working with inline images, calling w3m (from a script¹) 
> to display those html messages is practically same as displaying them in 
> the pager area.
> 
> ¹ similar to this one: http://zhar.net/projects/shell/mutt-view-html

This is actually a nice idea.

The script can be made safer by using mktemp to create the
temporary file and directory:


-tmpdir=/tmp/mutthtmltmpdir
-mbox=/tmp/tmpbox
+mbox=`mktemp -t mutt-html-mbox.XXXXXXXXXX` || exit 1
+cat - > $mbox
+tmpdir=`mktemp -d -t mutt-view-html.XXXXXXXXXX` || exit 1

-mkdir $tmpdir


and then pipe the message instead of copying it:

macro index,pager <F7> "\
<enter-command> set my_wait_key=\$wait_key wait_key=no<enter>\
<pipe-message>mutt-view-html.sh<enter>\
<enter-command> set wait_key=\$my_wait_key &my_wait_key<enter>\
" "view HTML in browser"

c
-- 
Python Mutt utilities <http://www.blacktrash.org/hg/muttils/>