comparison lisp/startup.el @ 217:d44af0c54775 r20-4b7

Import from CVS: tag r20-4b7
author cvs
date Mon, 13 Aug 2007 10:08:34 +0200
parents 1f0dabaa0855
children 0e522484dd2a
comparison
equal deleted inserted replaced
216:43306a74e31c 217:d44af0c54775
1030 (or 1030 (or
1031 ;; 1031 ;;
1032 ;; If this directory is a plausible root of the XEmacs tree, return it. 1032 ;; If this directory is a plausible root of the XEmacs tree, return it.
1033 ;; 1033 ;;
1034 (and (or (not lisp-p) 1034 (and (or (not lisp-p)
1035 (file-directory-p (expand-file-name "lisp/prim" dir))) 1035 (file-directory-p (expand-file-name "lisp" dir)))
1036 (or (file-directory-p (expand-file-name "lib-src" dir)) 1036 (or (file-directory-p (expand-file-name "lib-src" dir))
1037 (file-directory-p (expand-file-name system-configuration dir))) 1037 (file-directory-p (expand-file-name system-configuration dir)))
1038 dir) 1038 dir)
1039 ;; 1039 ;;
1040 ;; If the parent of this directory is a plausible root, use it. 1040 ;; If the parent of this directory is a plausible root, use it.
1041 ;; (But don't do so recursively!) 1041 ;; (But don't do so recursively!)
1042 ;; 1042 ;;
1043 (and (or (not lisp-p) 1043 (and (or (not lisp-p)
1044 (file-directory-p (expand-file-name "../lisp/prim" dir))) 1044 (file-directory-p (expand-file-name "../lisp" dir)))
1045 (or (file-directory-p (expand-file-name 1045 (or (file-directory-p (expand-file-name
1046 (format "../%s" system-configuration) 1046 (format "../%s" system-configuration)
1047 dir)) 1047 dir))
1048 (file-directory-p (expand-file-name "../lib-src" dir))) 1048 (file-directory-p (expand-file-name "../lib-src" dir)))
1049 (expand-file-name "../" dir)) 1049 (expand-file-name "../" dir))
1050 1050
1051 ;; 1051 ;;
1052 ;; (--run-in-place) Same thing, but from one directory level deeper. 1052 ;; (--run-in-place) Same thing, but from one directory level deeper.
1053 ;; 1053 ;;
1054 (and (or (not lisp-p) 1054 (and (or (not lisp-p)
1055 (file-directory-p (expand-file-name "../../lisp/prim" dir))) 1055 (file-directory-p (expand-file-name "../../lisp" dir)))
1056 (or (file-directory-p (expand-file-name 1056 (or (file-directory-p (expand-file-name
1057 (format "../%s" system-configuration) 1057 (format "../%s" system-configuration)
1058 dir)) 1058 dir))
1059 (file-directory-p 1059 (file-directory-p
1060 (expand-file-name 1060 (expand-file-name
1065 ;; This is of the form "xemacs-19.10/" or "xemacs-19.10-b7/". 1065 ;; This is of the form "xemacs-19.10/" or "xemacs-19.10-b7/".
1066 ;; 1066 ;;
1067 (let ((ver-dir (concat "../" (startup-make-version-dir)))) 1067 (let ((ver-dir (concat "../" (startup-make-version-dir))))
1068 (and (or (not lisp-p) 1068 (and (or (not lisp-p)
1069 (file-directory-p (expand-file-name 1069 (file-directory-p (expand-file-name
1070 (format "%s/lisp/prim" ver-dir) 1070 (format "%s/lisp" ver-dir)
1071 dir))) 1071 dir)))
1072 (or (file-directory-p (expand-file-name 1072 (or (file-directory-p (expand-file-name
1073 (format "%s/%s" ver-dir 1073 (format "%s/%s" ver-dir
1074 system-configuration) 1074 system-configuration)
1075 dir)) 1075 dir))
1081 ;; Same thing, but one higher: ../../lib/xemacs-<version>. 1081 ;; Same thing, but one higher: ../../lib/xemacs-<version>.
1082 ;; 1082 ;;
1083 (let ((ver-dir (concat "../../" (startup-make-version-dir)))) 1083 (let ((ver-dir (concat "../../" (startup-make-version-dir))))
1084 (and (or (not lisp-p) 1084 (and (or (not lisp-p)
1085 (file-directory-p (expand-file-name 1085 (file-directory-p (expand-file-name
1086 (format "%s/lisp/prim" ver-dir) 1086 (format "%s/lisp" ver-dir)
1087 dir))) 1087 dir)))
1088 (or (file-directory-p (expand-file-name 1088 (or (file-directory-p (expand-file-name
1089 (format "%s/%s" ver-dir 1089 (format "%s/%s" ver-dir
1090 system-configuration) 1090 system-configuration)
1091 dir)) 1091 dir))
1108 ;; 1108 ;;
1109 nil))) 1109 nil)))
1110 1110
1111 (defun find-emacs-root-internal (path) 1111 (defun find-emacs-root-internal (path)
1112 ;; (send-string-to-terminal (format "FINDING ROOT FOR %S\n" path)) 1112 ;; (send-string-to-terminal (format "FINDING ROOT FOR %S\n" path))
1113 ;; first look for lisp/prim and lib-src; then just look for lib-src. 1113 ;; first look for lisp and lib-src; then just look for lib-src.
1114 ;; XEmacs can run (kind of) if the lisp directory is omitted, which 1114 ;; XEmacs can run (kind of) if the lisp directory is omitted, which
1115 ;; some people might want to do for space reasons. 1115 ;; some people might want to do for space reasons.
1116 (or (find-emacs-root-internal-1 path t) 1116 (or (find-emacs-root-internal-1 path t)
1117 ;; (find-emacs-root-internal-1 path nil) 1117 ;; (find-emacs-root-internal-1 path nil)
1118 ;; If we don't succeed we are going to crash and burn for sure. 1118 ;; If we don't succeed we are going to crash and burn for sure.