From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mike Kupfer Newsgroups: gmane.emacs.bugs Subject: bug#30669: Suppress "No MH variant found" messages Date: Sun, 04 Mar 2018 13:59:01 -0800 Message-ID: <20663.1520200741__12491.4957130843$1520200801$gmane$org@alto> References: <7e7eqvejp2.fsf@fencepost.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: blaine.gmane.org 1520200801 30800 195.159.176.226 (4 Mar 2018 22:00:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 4 Mar 2018 22:00:01 +0000 (UTC) Cc: Bill Wohler , 30669@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 04 22:59:56 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esbfg-0007Uj-79 for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Mar 2018 22:59:56 +0100 Original-Received: from localhost ([::1]:46240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esbhi-0006ZO-Vo for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Mar 2018 17:02:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esbfs-00058y-GQ for bug-gnu-emacs@gnu.org; Sun, 04 Mar 2018 17:00:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esbfm-000606-RS for bug-gnu-emacs@gnu.org; Sun, 04 Mar 2018 17:00:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36878) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1esbfm-000600-OA for bug-gnu-emacs@gnu.org; Sun, 04 Mar 2018 17:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1esbfm-0008NJ-Fe; Sun, 04 Mar 2018 17:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mike Kupfer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, mh-e-devel@lists.sourceforge.net Resent-Date: Sun, 04 Mar 2018 22:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30669 X-GNU-PR-Package: emacs,mh-e X-GNU-PR-Keywords: patch Original-Received: via spool by 30669-submit@debbugs.gnu.org id=B30669.152020075232108 (code B ref 30669); Sun, 04 Mar 2018 22:00:02 +0000 Original-Received: (at 30669) by debbugs.gnu.org; 4 Mar 2018 21:59:12 +0000 Original-Received: from localhost ([127.0.0.1]:44775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esbey-0008Lo-Eg for submit@debbugs.gnu.org; Sun, 04 Mar 2018 16:59:12 -0500 Original-Received: from shell1.rawbw.com ([198.144.192.42]:53616 ident=root) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esbew-0008Lf-7K for 30669@debbugs.gnu.org; Sun, 04 Mar 2018 16:59:10 -0500 Original-Received: from alto (96-95-200-133-static.hfc.comcastbusiness.net [96.95.200.133]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id w24Lx2wi033860 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 4 Mar 2018 13:59:08 -0800 (PST) (envelope-from mkupfer@alum.berkeley.edu) X-Authentication-Warning: shell1.rawbw.com: Host 96-95-200-133-static.hfc.comcastbusiness.net [96.95.200.133] claimed to be alto In-Reply-To: Your message of "Fri, 02 Mar 2018 21:38:54 -0500." <7amuzprigx.fsf@fencepost.gnu.org> X-Mailer: MH-E 8.6+git; nmh 1.6; GNU Emacs 26.0.91 Content-ID: <20662.1520200741.1@alto> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143905 Archived-At: 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