From 0d42c92978491588a3ad67ec59a5e105e8f1ab3a Mon Sep 17 00:00:00 2001 From: Stephen Gildea Date: Mon, 7 Jun 2021 21:47:24 -0700 Subject: [PATCH] MH-E: do not look for MH variants in relative directories * lisp/mh-e/mh-e.el (mh-variants): Do not examine relative directories in exec-path (e.g., "."); these won't have MH installed. Also, file-chase-links is not robust with relative names: you cannot pass it a relative name that is a symlink. --- lisp/mh-e/mh-e.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 1aac3374153..e935cfda97e 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -738,8 +738,11 @@ is described by the variable `mh-variants'." ;; Make a unique list of directories, keeping the given order. ;; We don't want the same MH variant to be listed multiple times. (cl-loop for dir in (append mh-path mh-sys-path exec-path) do - (setq dir (file-chase-links (directory-file-name dir))) - (cl-pushnew dir list-unique :test #'equal)) + ;; skip relative dirs, typically "." + (if (file-name-absolute-p dir) + (progn + (setq dir (file-chase-links (directory-file-name dir))) + (cl-pushnew dir list-unique :test #'equal)))) (cl-loop for dir in (nreverse list-unique) do (when (and dir (file-accessible-directory-p dir)) (let ((variant (mh-variant-info dir))) -- 2.39.5