unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: 30669@debbugs.gnu.org
Subject: bug#30669: Suppress "No MH variant found" messages
Date: Thu, 01 Mar 2018 13:26:17 -0500	[thread overview]
Message-ID: <7e7eqvejp2.fsf@fencepost.gnu.org> (raw)

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"))
 





             reply	other threads:[~2018-03-01 18:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 18:26 Glenn Morris [this message]
2018-03-01 19:27 ` bug#30669: Suppress "No MH variant found" messages Eli Zaretskii
2018-03-02  5:08   ` Bill Wohler
2018-03-03  2:38     ` Glenn Morris
2018-03-04 21:59       ` Mike Kupfer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e7eqvejp2.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=30669@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).