Hi,
Emilio Torres Manzanera <
tor...@uniovi.es> writes:
> Hi Dirk,
>
> you are right, I am using
> (setq mu4e-html2text-command "html2text -utf8 -width 72")
> and it seems that the conversion eats the link.
>
> Would you please implement an option to toggle the view between plain
> format and html format? For instance, pressing key 'v' converts the
> body of the mail into a browser buffer (browse-url-of-buffer or
> similar function)
You can use the actions system for this; below, a bit hackish way using
'mu extract' to view a message in an external web browser:
---
(defun mu4e-action-view-in-browser (msg)
"Hack to view the html part for MSG in a web browser."
(let* ((shellpath (shell-quote-argument (mu4e-msg-field msg :path)))
(partnum
(shell-command-to-string
(format "%s extract %s | grep 'text/html' | awk '{print $1}'"
mu4e-mu-binary shellpath))))
(unless (> (length partnum) 0)
(error "No html part for this message"))
(call-process-shell-command
(format "cd %s; %s extract %s --parts=%s --overwrite --play"
(shell-quote-argument temporary-file-directory)
mu4e-mu-binary shellpath (substring partnum 0 -1)))))
(add-to-list 'mu4e-view-actions
'("View in browser" ?v mu4e-action-view-in-browser) t)
---
Now, 'a v' in the view should do the trick. If you want to view things
inside emacs (e.g, using w3m), I guess you could adapt the latter part
of the function. *Left as an exercise for the reader*
I have some ideas about making this less hacky; stay tuned.
Best wishes,
Dirk.
--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:
www.djcbsoftware.nl