html2text is deprecated in the emacs pretest, by unconditionally
importing it mu4e causes a mildly irritating yes/no prompt to appear
during startup.
This change ensures that html2text is not loaded unless the emacs
running is a version that does not have 'shr-insert-document
Rework the conversion from html to text; the functions doing that now
expect to receive one parameter, the message, and return the converted
message.
In the old way, the function got invoked in a buffer with html text, and
were expected to modify it to text. This old way is still supported for
backward compatibility.
Add a `msg' parameter to html2text functions, but for backward
compatibility, introspect the functions, and if they don't support it,
use the old ways of running the function in the context of a buffer with
the html text.
Make mu4e-view-toggle-html _not_ toggle the global value of of
mu4e-view-prefer-html, but only the current one.
Make the link map 'permanent', so it survives the buffer changes when
refreshing. This fixes issue #904.
Clean up the creation of html files a bit, and automatically clean them
up after a short while, so we don't clutter /tmp.
Refactor the html-generating actions, so we don't repeat ourselves too
much.
Some mails were not showing; this was because they had a short (useless)
text part and an html-part with the content. However, the short part was
still too big to fail our heuristic in
mu4e-view-html-plaintext-ratio-heuristic
Set it to 5 instead. This fixed#743, though not the more general case.
Add a custom var to enable the customisation of the ratio between the length of the html and the plaintext parts under which the text is considered to be garbage
The first sentence should summarize the variable's or function's
purpose and it should fit on the first line. Change existing
doc-string by:
* Move first sentence onto first line even if that makes it _a bit_
long.
* Move additional notes out of first sentence and add them later,
possibly as complete sentences.
* If I am uncertain whether doing the above would alter the meaning,
_don't_ do it.
* If fitting the initial sentence on the first line would require a
complete rewrite of the doc-string _don't_ do so unless it is very
easy to do.
* Remove indentation from second and later lines if it is there to
align them with the first in the source code, instead of in
`describe-*' output.
* Make "pullet point" lists a bit more consistent.
Obviously this does not fix all problems but it's a start.