all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#30669: Suppress "No MH variant found" messages
@ 2018-03-01 18:26 Glenn Morris
  2018-03-01 19:27 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2018-03-01 18:26 UTC (permalink / raw)
  To: 30669

Package: emacs,mh-e
Version: 26.1
Severity: minor

It's a long-standing issue that simply loading mh-e.el (eg when building
Emacs) often prints "No MH variant found on the system".

Ref eg https://sourceforge.net/p/mh-e/bugs/484/

Here's an attempt at a fix.
I have no systems configured to read mail with MH,
so this is largely untested.


   Suppress "No MH variant found" message
   * mh-e.el (mh-variant): Don't try to detect till actually needed.
   * mh-e.el (mh-version, mh-variant-p):
   * mh-comp.el (mh-insert-x-mailer): Ensure mh-variant-in-use is set.

diff --git i/lisp/mh-e/mh-comp.el w/lisp/mh-e/mh-comp.el
index cfdd2ae..c57e129 100644
--- i/lisp/mh-e/mh-comp.el
+++ w/lisp/mh-e/mh-comp.el
@@ -1056,6 +1056,7 @@ mh-compose-and-send-mail
 (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 'autodetect))
   ;; 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 i/lisp/mh-e/mh-e.el w/lisp/mh-e/mh-e.el
index 05ff672..94b029b 100644
--- i/lisp/mh-e/mh-e.el
+++ w/lisp/mh-e/mh-e.el
@@ -430,6 +430,7 @@ mh-version
   ;; Emacs version.
   (insert (emacs-version) "\n\n")
   ;; MH version.
+  (or mh-variant-in-use (mh-variant-set 'autodetect))
   (if mh-variant-in-use
       (insert mh-variant-in-use "\n"
               " mh-progs:\t" mh-progs "\n"
@@ -876,6 +877,7 @@ mh-variant-set-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 'autodetect))
   (let ((variant-in-use
          (cadr (assoc 'variant (assoc mh-variant-in-use (mh-variants))))))
     (not (null (member variant-in-use variants)))))
@@ -972,6 +974,7 @@ mh-variant
   :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"))
 





^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-04 21:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-01 18:26 bug#30669: Suppress "No MH variant found" messages Glenn Morris
2018-03-01 19:27 ` Eli Zaretskii
2018-03-02  5:08   ` Bill Wohler
2018-03-03  2:38     ` Glenn Morris
2018-03-04 21:59       ` Mike Kupfer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.