From 5d0e8ddd8e31227a48a333a02b4769fda5b87da1 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 25 Mar 1997 02:22:04 +0000 Subject: [PATCH] (mh-find-progs): When looking for mh-lib, construct likely paths based on mh-progs rather than using a static list. --- lisp/mail/mh-utils.el | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/lisp/mail/mh-utils.el b/lisp/mail/mh-utils.el index d2505918c86..e7c7460ceab 100644 --- a/lisp/mail/mh-utils.el +++ b/lisp/mail/mh-utils.el @@ -26,7 +26,7 @@ ;;; Change Log: -;; $Id: mh-utils.el,v 1.9 1996/01/29 23:17:16 kwzh Exp rms $ +;; $Id: mh-utils.el,v 1.10 1996/06/28 06:56:17 rms Exp rms $ ;;; Code: @@ -576,14 +576,21 @@ Non-nil third argument means not to show the message." "/usr/local/bin/"))) (or (file-exists-p (expand-file-name "mhl" mh-lib)) (setq mh-lib - (or (mh-path-search '("/usr/local/lib/mh/" - "/usr/local/mh/lib/" - "/usr/local/bin/mh/" - "/usr/lib/mh/" ;Ultrix 4.2 - "/usr/new/lib/mh/" ;Ultrix <4.2 - "/usr/contrib/mh/lib/" ;BSDI - ) - "mhl") + ;; Look for a lib directory roughly parallel to the bin + ;; directory: Strip any trailing `mh' or `bin' path + ;; components, then look for lib/mh or mh/lib. + (or (let ((mh-base mh-progs)) + (while (let ((dir-name (file-name-nondirectory + (directory-file-name mh-base)))) + (or (string= "mh" dir-name) + (string= "bin" dir-name))) + (setq mh-base + (file-name-directory (directory-file-name mh-base)))) + (mh-path-search + (list (expand-file-name "lib/mh/" mh-base) + (expand-file-name "mh/lib/" mh-base)) + "mhl")) + (mh-path-search '("/usr/local/bin/mh/") "mhl") (mh-path-search exec-path "mhl") ;unlikely mh-lib "/usr/local/lib/mh/")))) -- 2.39.2