Commit d6c50891 authored by Victor A. Stoichiţă's avatar Victor A. Stoichiţă
Browse files

new simpler way to add view with xwidget action

parent bf071704
......@@ -228,24 +228,9 @@
))
;;; ACTIONS:
;; new action on key x works only for emacs with xwidget support
(defun my-mu4e-action-view-with-xwidget (msg)
"View the body of the message inside xwidget-webkit."
(unless (fboundp 'xwidget-webkit-browse-url)
(mu4e-error "No xwidget support available"))
(let* ((html (mu4e-message-field msg :body-html))
(txt (mu4e-message-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
;; simplistic -- but note that it's only an example...
(insert (or html (concat "<pre>" txt "</pre>")))
(write-file tmpfile)
(xwidget-webkit-browse-url (concat "file://" tmpfile) t))))
(add-to-list 'mu4e-view-actions
'("xViewXWidget" . my-mu4e-action-view-with-xwidget) t)
'("xViewXWidget" . mu4e-action-view-with-xwidget) t)
;; mu4e-action-view-in-browser is built into mu4e
;; by adding it to these lists of custom actions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment