mu4e: fix toggling between html/text
This commit is contained in:
@ -254,7 +254,13 @@ found."
|
||||
(mu4e~view-custom-field msg field))))))
|
||||
mu4e-view-fields "")
|
||||
"\n"
|
||||
(let ((body (mu4e-message-body-text msg mu4e-view-prefer-html)))
|
||||
(let* ((prefer-html
|
||||
(cond
|
||||
((eq mu4e~view-html-text 'html) t)
|
||||
((eq mu4e~view-html-text 'text) nil)
|
||||
(t mu4e-view-prefer-html)))
|
||||
(body (mu4e-message-body-text msg prefer-html)))
|
||||
(setq mu4e~view-html-text nil)
|
||||
(when (fboundp 'add-face-text-property)
|
||||
(add-face-text-property 0 (length body) 'mu4e-view-body-face t body))
|
||||
body)))
|
||||
@ -969,11 +975,16 @@ the new docid. Otherwise, return nil."
|
||||
(mu4e-view-refresh)
|
||||
(mu4e~view-hide-cited)))
|
||||
|
||||
(defvar mu4e~view-html-text nil
|
||||
"Should we prefer html or text just this once? A symbol `text'
|
||||
or `html' or nil.")
|
||||
|
||||
(defun mu4e-view-toggle-html ()
|
||||
"Toggle html-display of the message body (if any)."
|
||||
(interactive)
|
||||
(let ((mu4e-view-prefer-html (not mu4e~message-body-html)))
|
||||
(mu4e-view-refresh)))
|
||||
(setq mu4e~view-html-text
|
||||
(if mu4e~message-body-html 'text 'html))
|
||||
(mu4e-view-refresh))
|
||||
|
||||
(defun mu4e-view-refresh ()
|
||||
"Redisplay the current message."
|
||||
|
||||
Reference in New Issue
Block a user