mirror of
https://github.com/djcb/mu.git
synced 2024-06-29 07:51:04 +02:00
* fix mu4e-action-view-in-browser (thanks semente!)
This commit is contained in:
parent
fe82c505d9
commit
81f74219b2
|
@ -75,16 +75,16 @@ view."
|
||||||
(defun mu4e-action-view-in-browser (msg)
|
(defun mu4e-action-view-in-browser (msg)
|
||||||
"View the body of the message in a web browser. You can influence
|
"View the body of the message in a web browser. You can influence
|
||||||
the browser to use with the variable `browse-url-generic-program'."
|
the browser to use with the variable `browse-url-generic-program'."
|
||||||
(let* ((html (mu4e-msg-field msg :body-htm ))
|
(let* ((html (mu4e-msg-field msg :body-html))
|
||||||
(txt (mu4e-msg-field msg :body-txt))
|
(txt (mu4e-msg-field msg :body-txt))
|
||||||
(tmpfile (format "%s/%d.html" temporary-file-directory (random))))
|
(tmpfile (format "%s%x.html" temporary-file-directory (random t))))
|
||||||
(unless (or html txt)
|
(unless (or html txt)
|
||||||
(mu4e-error "No body part for this message"))
|
(mu4e-error "No body part for this message"))
|
||||||
(with-temp-buffer
|
(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 "<pre>" txt "</pre>")))
|
(insert (or html (concat "<pre>" txt "</pre>")))
|
||||||
(when (write-file tmpfile)
|
(write-file tmpfile)
|
||||||
(url-view-url (concat "file:///" tmpfile))))))
|
(browse-url (concat "file://" tmpfile)))))
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user