1

I'd like to display inline images in html email in mu4e. I tried to ask to the creator of mu4e, but he told me that it's out of the scope of mu4e to do that. However, I can display for example the mail in my browser using:

(defun mu4e-my-show-in-browser ()
  "Display in browser the email"
  (interactive)
  (mu4e-action-view-in-browser (mu4e-action-view-in-browser (mu4e-message-at-point t))))

so I guess it's not a fundamental issue, and that it may be possible to use an emacs html browser to display the email... Any idea?

Thanks.

-- EDIT 1 -- I found a first solution using w3m (make sure to install it). Note that you may need to press T in w3m to toggle image display.

;; Enable images in w3m
(setq w3m-default-desplay-inline-images t)
(defun mu4e-action-view-in-w3m ()
  "View the body of the message in emacs w3m."
  (interactive)
  (w3m-browse-url (concat "file://"
              (mu4e~write-body-to-html (mu4e-message-at-point t)))))

I don't know why but the transparent images are displayed strangely (anti-aliasing maybe), but it's another problem. And also it would be nice to add a few hooks to be able to answer to the email directly from this. If you have a better solution, let me know!

  • It is not hard to put image overlays into buffers (see kitchingroup.cheme.cmu.edu/blog/2016/03/21/…) for example. If you can figure out how to get a path to the image, or to create a tmp file from base64 encoded data, you can probably use a hook to insert an overlay into the message. – John Kitchin May 30 '18 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.