changeset 17243:46ee9938fec6

(mh-find-progs): When looking for mh-lib, construct likely paths based on mh-progs rather than using a static list.
author Richard M. Stallman <rms@gnu.org>
date Tue, 25 Mar 1997 02:22:04 +0000
parents 7dd0da53476f
children 6d46f493d819
files lisp/mail/mh-utils.el
diffstat 1 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/mh-utils.el	Mon Mar 24 23:59:44 1997 +0000
+++ b/lisp/mail/mh-utils.el	Tue Mar 25 02:22:04 1997 +0000
@@ -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 @@
 		"/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/"))))