From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#30669: Suppress "No MH variant found" messages Date: Thu, 01 Mar 2018 13:26:17 -0500 Message-ID: <7e7eqvejp2.fsf@fencepost.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1519928709 4275 195.159.176.226 (1 Mar 2018 18:25:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Mar 2018 18:25:09 +0000 (UTC) User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) To: 30669@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 01 19:25:05 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 1erSt6-0000TG-7Z for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Mar 2018 19:25:04 +0100 Original-Received: from localhost ([::1]:58692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erSv8-0007jB-JY for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Mar 2018 13:27:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erSv1-0007is-Va for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2018 13:27:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erSv1-000282-3l for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2018 13:27:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59949) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1erSv0-00027s-Vm for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2018 13:27:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1erSv0-0000IG-K0; Thu, 01 Mar 2018 13:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, mh-e-devel@lists.sourceforge.net Resent-Date: Thu, 01 Mar 2018 18:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30669 X-GNU-PR-Package: emacs,mh-e X-GNU-PR-Keywords: X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15199287861076 (code B ref -1); Thu, 01 Mar 2018 18:27:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Mar 2018 18:26:26 +0000 Original-Received: from localhost ([127.0.0.1]:39612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erSuQ-0000HI-1J for submit@debbugs.gnu.org; Thu, 01 Mar 2018 13:26:26 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38563) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erSuP-0000H6-80 for submit@debbugs.gnu.org; Thu, 01 Mar 2018 13:26:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erSuJ-0001hR-9w for submit@debbugs.gnu.org; Thu, 01 Mar 2018 13:26:20 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erSuJ-0001hI-4j for submit@debbugs.gnu.org; Thu, 01 Mar 2018 13:26:19 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1erSuH-0003tq-HD; Thu, 01 Mar 2018 13:26:17 -0500 X-Spook: Homeland Defense world domination Legion of Doom X-Ran: e@E0!S4Rm~.>:ornC~-ZP]OMl.NBOrI^-s:15]E*4=1B$r?~g#tq[Jog?5w;t8v)3R?$`9 X-Hue: green X-Attribution: GM X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:143794 Archived-At: 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"))