diff options
author | Stephen Gildea <stepheng+emacs@gildea.com> | 2021-09-17 07:01:40 -0700 |
---|---|---|
committer | Stephen Gildea <stepheng+emacs@gildea.com> | 2021-09-17 07:10:58 -0700 |
commit | 2598b8874edc266667108411c9c3c728b7eda609 (patch) | |
tree | c9142a8f55054258384eddbca2c052e2380f0082 /lisp/mh-e/mh-e.el | |
parent | 6397faaaf9b9e47f73d56f330e4964517d646968 (diff) | |
download | emacs-2598b8874edc266667108411c9c3c728b7eda609.tar.gz emacs-2598b8874edc266667108411c9c3c728b7eda609.tar.bz2 emacs-2598b8874edc266667108411c9c3c728b7eda609.zip |
MH-E: fix check for nmh or Mailutils installation
* lisp/mh-e/mh-e.el (mh-variant-gnu-mh-info, mh-variant-nmh-info):
Run install-mh, not mhparam, to check whether an MH variant is
installed on the system. mhparam fails if no user profile is found,
so it is not a reliable check of the state of the system as a whole.
Tested with:
nmh 1.4, nmh 1.7.1, GNU Mailutils 2.2, GNU Mailutils 3.7, GNU Mailutils 3.13
Diffstat (limited to 'lisp/mh-e/mh-e.el')
-rw-r--r-- | lisp/mh-e/mh-e.el | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 52fb11be6fc..9cbc8cfb737 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -785,14 +785,16 @@ is described by the variable `mh-variants'." (defun mh-variant-gnu-mh-info (dir) "Return info for GNU mailutils MH variant in DIR. This assumes that a temporary buffer is set up." - ;; 'mhparam -version' output: + ;; Sample '-version' outputs: ;; mhparam (GNU mailutils 0.3.2) - (let ((mhparam (expand-file-name "mhparam" dir))) - (when (mh-file-command-p mhparam) + ;; install-mh (GNU Mailutils 2.2) + ;; install-mh (GNU Mailutils 3.7) + (let ((install-mh (expand-file-name "install-mh" dir))) + (when (mh-file-command-p install-mh) (erase-buffer) - (call-process mhparam nil '(t nil) nil "-version") + (call-process install-mh nil '(t nil) nil "-version") (goto-char (point-min)) - (when (search-forward-regexp "mhparam (\\(GNU [Mm]ailutils \\S +\\))" + (when (search-forward-regexp "install-mh (\\(GNU [Mm]ailutils \\S +\\))" nil t) (let ((version (match-string 1)) (mh-progs dir)) @@ -806,14 +808,15 @@ This assumes that a temporary buffer is set up." (defun mh-variant-nmh-info (dir) "Return info for nmh variant in DIR assuming a temporary buffer is set up." - ;; `mhparam -version' outputs: + ;; Sample '-version' outputs: ;; mhparam -- nmh-1.1-RC1 [compiled on chaak at Fri Jun 20 11:03:28 PDT 2003] - (let ((mhparam (expand-file-name "mhparam" dir))) - (when (mh-file-command-p mhparam) + ;; install-mh -- nmh-1.7.1 built October 26, 2019 on build-server-000 + (let ((install-mh (expand-file-name "install-mh" dir))) + (when (mh-file-command-p install-mh) (erase-buffer) - (call-process mhparam nil '(t nil) nil "-version") + (call-process install-mh nil '(t nil) nil "-version") (goto-char (point-min)) - (when (search-forward-regexp "mhparam -- nmh-\\(\\S +\\)" nil t) + (when (search-forward-regexp "install-mh -- nmh-\\(\\S +\\)" nil t) (let ((version (format "nmh %s" (match-string 1))) (mh-progs dir)) `(,version |