all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mike Kupfer <mkupfer@alum.berkeley.edu>
To: Glenn Morris <rgm@gnu.org>
Cc: Bill Wohler <wohler@newt.com>, 30669@debbugs.gnu.org
Subject: bug#30669: Suppress "No MH variant found" messages
Date: Sun, 04 Mar 2018 13:59:01 -0800	[thread overview]
Message-ID: <20663.1520200741__12491.4957130843$1520200801$gmane$org@alto> (raw)
In-Reply-To: Your message of "Fri, 02 Mar 2018 21:38:54 -0500." <7amuzprigx.fsf@fencepost.gnu.org>

Glenn Morris wrote:

> Minor revision:

Hi Glenn, thanks for the patch.  I ran it through some tests and made a
couple tweaks.

The first tweak is needed for the patch to be usable.  Without it, MH-E
recognizes which MH variants are installed, but it doesn't pick one,
which breaks both reading mail and sending it.  I fixed that by adding

    (or mh-variant-in-use (mh-variant-set mh-variant))

to #'mh-find-path.

The second tweak improves the error reporting in the case where no MH
variants can be found.  It's independent of this fix, but the issue came
up in my testing, so I figured I'd deal with it now.

The patch with both tweaks included is

diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -1054,6 +1054,7 @@
 (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
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -410,6 +410,8 @@
   (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 @@
   ;; 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 @@
 (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)))))
@@ -941,6 +945,8 @@
       (when (not (mh-variant-set-variant variant))
         (message "Warning: %s variant not found. Autodetecting..." variant)
         (mh-variant-set 'autodetect)))
+     ((null valid-list)
+      (message "Unknown variant %s; can't find MH anywhere" variant))
      (t
       (message "Unknown variant %s; use %s"
                variant
@@ -972,6 +978,7 @@
   :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"))
 
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -177,6 +177,7 @@
 variables if you need to run with different values between MH and
 MH-E."
   (unless mh-find-path-run
+    (or mh-variant-in-use (mh-variant-set mh-variant))
     ;; Sanity checks.
     (if (and (getenv "MH")
              (not (file-readable-p (getenv "MH"))))

cheers,
mike





      reply	other threads:[~2018-03-04 21:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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

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

  git send-email \
    --in-reply-to='20663.1520200741__12491.4957130843$1520200801$gmane$org@alto' \
    --to=mkupfer@alum.berkeley.edu \
    --cc=30669@debbugs.gnu.org \
    --cc=rgm@gnu.org \
    --cc=wohler@newt.com \
    /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 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.