Subject: [sup-talk] text/html => w3m?

From: [email-masked] (Daniel Wagner)
Date: Tue, 29 Jan 2008 11:33:48 -0800

Hello, how does sup know to use w3m for text/html attachments?  I had a
quick grep -R through the code for w3m, and it suggested that this could
be achieved with a user hook, but I have a completely empty
~/.sup/hooks.  I also thought it might be from some mime-style magic,
but

~% xdg-mime query default "text/html"
firefox.desktop

I'd really like for firefox to be the program used in fact, but I can't
see where to change this.

~d

P.S.  This is strongly related to another desire, to be sent in a new
thread.

---

From: [email-masked] (John Bent)
Date: Tue, 29 Jan 2008 12:59:01 -0700

> see where to change this.
You can use a hook 'mime-decode.rb' to cause text/html emails to be 
correctly rendered within sup.  For attachments, sup uses hook 'mime-view.rb'.
Since, your hook dir is empty (by the way, it is possible to set the home
dir for sup to something besides $HOME/.sup, so you might want to confirm
you're running from where you think you are), I believe sup uses 
/usr/bin/run-mailcap if there is no 'mime-view.rb'.

Hope this helps but I'm still learning sup too so this might all be wrong...

By the way, I'd like that other request you had also about being able to
open links within email bodies.

John

---

From: [email-masked] (Daniel Wagner)
Date: Tue, 29 Jan 2008 13:45:22 -0800

> /usr/bin/run-mailcap if there is no 'mime-view.rb'.

Oh, hey, run-mailcap is really quite nice.  Thanks for the tip!  I stuck
this in my ~/.mailcap, and I'm happy-scrappy now.

text/html; /usr/bin/firefox '%s'; edit=gvim '%s'; \
test=test "$DISPLAY" != ""; description="Web Page"; nametemplate=%s.html
text/html; /usr/bin/firefox '%s'; edit=gvim '%s'; \
test=test "$DISPLAY" != ""; description="Web Page"; nametemplate=%s.htm
text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; \
edit=vim '%s'; description="Web Page"; nametemplate=%s.html
text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; \
edit=vim '%s'; description="Web Page"; nametemplate=%s.htm

Sadly, this will not work for opening links, as run-mailcap only
recognizes files, and not URIs.

~d

---

From: [email-masked] (William Morgan)
Date: Tue, 29 Jan 2008 19:52:00 -0800

> Hope this helps but I'm still learning sup too so this might all be

Pretty much right. Sup uses run-mailcap by default, which is where w3m
is being picked up on your system. So you can change your mailcap, or
you can override the hook. Depends on whether you want this change to be
system-wide or specific to Sup.

-- 
William <wmorgan-sup at masanjin.net>