Only require html2text if it will be used

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
This commit is contained in:
Chris Nixon 2018-02-19 12:16:48 +00:00
parent 6fe67b354d
commit 7b6da1131b
1 changed files with 3 additions and 2 deletions

View File

@ -31,12 +31,13 @@
(require 'mu4e-utils)
(require 'cl)
(require 'html2text)
(require 'flow-fill)
(defcustom mu4e-html2text-command
(if (fboundp 'shr-insert-document) 'mu4e-shr2text 'html2text)
(if (fboundp 'shr-insert-document)
'mu4e-shr2text
(progn (require 'html2text) 'html2text))
"Either a shell command or a function that converts from html to plain text.