diff --git a/mu4e/mu4e-actions.el b/mu4e/mu4e-actions.el index 6d0338d3..41a3f43c 100644 --- a/mu4e/mu4e-actions.el +++ b/mu4e/mu4e-actions.el @@ -75,16 +75,16 @@ view." (defun mu4e-action-view-in-browser (msg) "View the body of the message in a web browser. You can influence the browser to use with the variable `browse-url-generic-program'." - (let* ((html (mu4e-msg-field msg :body-htm )) - (txt (mu4e-msg-field msg :body-txt)) - (tmpfile (format "%s/%d.html" temporary-file-directory (random)))) + (let* ((html (mu4e-msg-field msg :body-html)) + (txt (mu4e-msg-field msg :body-txt)) + (tmpfile (format "%s%x.html" temporary-file-directory (random t)))) (unless (or html txt) (mu4e-error "No body part for this message")) (with-temp-buffer - ;; this is simplistic -- but note that it's only an example + ;; simplistic -- but note that it's only an example... (insert (or html (concat "
" txt ""))) - (when (write-file tmpfile) - (url-view-url (concat "file:///" tmpfile)))))) + (write-file tmpfile) + (browse-url (concat "file://" tmpfile))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;