How access the HTML part of a message in notmuch-show?
reddit / emacs
----------------------------------------------------------------------
public_image_limited · 2022-09-16 08:59
I'm still struggling with the endless task of printing emails in
Emacs. Now I had the idea to use `pandoc` to convert the HTML mail (or
mail wrapped in HTML) to PDF. But I can't find any command (user-level
or elisp) to access the HTML part of an email from within `notmuch-
show`. I can store attachments, but the HTML part is not offered for
saving. And looking at the code, `notmuch` seems to relay on `mm-view`
and other stuff for which I could not find documentation. So,
basically, my question is: what functions can I use to access the HTML
part of a mail within the `notmuch-show` buffer so that I can pass it
to a process?
EDIT:
It's `mm-dissect-buffer`. When called wrapped within `with-current-
notmuch-show-messsage`, you get a list of `mm-handle` objects defining
the different parts of the mail viewed. To save the part, you can use
`mm-save-part-to-file`. There is even a search function `mm-find-part-
by-type`.
I'm down in the rabbit hole now! :)
----------------------------------------------------------------------
grimscythe_ · 2022-09-16 11:04
This could be a starting point for you
https://emacs.stackexchange.com/questions/63436/is-there-some-way-to-
view-the-html-part-of-an-email-in-an-external-browser-or-as
----------------------------------------------------------------------
public_image_limited · 2022-09-16 11:27
Good ol' stackexchange, thanks!
----------------------------------------------------------------------
public_image_limited · 2022-09-16 18:47
I played around a bit and gor really frustrated by the lack of
documentation for the `mm-....` functions. If anyone has a good idea,
I'd appreciate some pointers. I can read the source code, but there
are some irregular results when applying these functions to some
selected mails, so I'm obviously missing stuff.