From: Glenn Morris Date: Thu, 8 Mar 2018 06:56:23 +0000 (-0800) Subject: Suppress "No MH variant found" message (bug#30669) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f0512cded2094ea7f60c0b65f4e0117c554b9533;p=emacs.git Suppress "No MH variant found" message (bug#30669) * lisp/mh-e/mh-e.el (mh-variant): Don't try to detect till needed. * lisp/mh-e/mh-e.el (mh-version, mh-variant-p): * lisp/mh-e/mh-comp.el (mh-insert-x-mailer): Ensure mh-variant-in-use is set. --- diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index cfdd2ae5abf..941529330e1 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el @@ -1056,6 +1056,7 @@ letter." (defun mh-insert-x-mailer () "Append an X-Mailer field to the header. The versions of MH-E, Emacs, and MH are shown." + (or mh-variant-in-use (mh-variant-set mh-variant)) ;; Lazily initialize mh-x-mailer-string. (when (and mh-insert-x-mailer-flag (null mh-x-mailer-string)) (setq mh-x-mailer-string diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 05ff672da52..7b587a80d16 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -410,6 +410,8 @@ gnus-version) (require 'gnus) gnus-version) +(defvar mh-variant) + ;;;###autoload (defun mh-version () "Display version information about MH-E and the MH mail handling system." @@ -430,6 +432,7 @@ gnus-version) ;; Emacs version. (insert (emacs-version) "\n\n") ;; MH version. + (or mh-variant-in-use (mh-variant-set mh-variant)) (if mh-variant-in-use (insert mh-variant-in-use "\n" " mh-progs:\t" mh-progs "\n" @@ -876,6 +879,7 @@ variant." (defun mh-variant-p (&rest variants) "Return t if variant is any of VARIANTS. Currently known variants are `MH', `nmh', and `gnu-mh'." + (or mh-variant-in-use (mh-variant-set mh-variant)) (let ((variant-in-use (cadr (assoc 'variant (assoc mh-variant-in-use (mh-variants)))))) (not (null (member variant-in-use variants))))) @@ -972,6 +976,7 @@ necessary and can actually cause problems." :set (lambda (symbol value) (set-default symbol value) ;Done in mh-variant-set-variant! (mh-variant-set value)) + :initialize 'custom-initialize-default :group 'mh-e :package-version '(MH-E . "8.0"))