From 62c028b647a4292e2d313ff4175fc2fad7ffd7c3 Mon Sep 17 00:00:00 2001 From: djcb Date: Sun, 31 Jan 2016 12:48:12 +0200 Subject: [PATCH 1/2] mu4e: explicitly specify utf8 for html-view actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Explicitly add the (html 5) for UTF-8; not all browsers default to UTF-8 and could show the class "Â" characters when interpreting UTF-8 as ISO-8859-1. --- mu4e/mu4e-actions.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mu4e/mu4e-actions.el b/mu4e/mu4e-actions.el index df5df87e..dc5ee985 100644 --- a/mu4e/mu4e-actions.el +++ b/mu4e/mu4e-actions.el @@ -84,6 +84,7 @@ You can influence the browser to use with the variable (mu4e-error "No body part for this message")) (with-temp-buffer ;; simplistic -- but note that it's only an example... + (insert "\n") (insert (or html (concat "
" txt "
"))) (write-file tmpfile) (browse-url (concat "file://" tmpfile))))) @@ -104,6 +105,7 @@ You can influence the browser to use with the variable (mu4e-error "No body part for this message")) (with-temp-buffer ;; simplistic -- but note that it's only an example... + (insert "\n") (insert (or html (concat "
" txt "
"))) (write-file tmpfile) (xwidget-webkit-browse-url (concat "file://" tmpfile) t)))) From e3434c2772a1b4580af9023b2aa933344ae13125 Mon Sep 17 00:00:00 2001 From: Thomas Moulia Date: Sun, 31 Jan 2016 21:48:41 -0800 Subject: [PATCH 2/2] mu4e: fix compose cancel orphaning a buffer Create buffer contents _before_ creating the file. --- mu4e/mu4e-draft.el | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mu4e/mu4e-draft.el b/mu4e/mu4e-draft.el index 7f6e0c86..dd5dd4e7 100644 --- a/mu4e/mu4e-draft.el +++ b/mu4e/mu4e-draft.el @@ -430,17 +430,18 @@ from either `mu4e~draft-reply-construct', or (format "%s/%s/cur/%s" mu4e-maildir draft-dir - (mu4e~draft-message-filename-construct "DS")))) - (if (and mu4e-compose-in-new-frame (window-system)) + (mu4e~draft-message-filename-construct "DS"))) + (initial-contents + (case compose-type + (reply (mu4e~draft-reply-construct msg)) + (forward (mu4e~draft-forward-construct msg)) + (new (mu4e~draft-newmsg-construct)) + (t (mu4e-error "unsupported compose-type %S" compose-type))))) + (if (and mu4e-compose-in-new-frame (window-system)) (find-file-other-frame draft-path) - (find-file draft-path))) - (insert - (case compose-type - (reply (mu4e~draft-reply-construct msg)) - (forward (mu4e~draft-forward-construct msg)) - (new (mu4e~draft-newmsg-construct)) - (t (mu4e-error "unsupported compose-type %S" compose-type)))) - (newline) + (find-file draft-path)) + (insert initial-contents)) + (newline) ;; include the message signature (if it's set) (if (and mu4e-compose-signature-auto-include mu4e-compose-signature) (let ((message-signature mu4e-compose-signature))