comparison lisp/setup-paths.el @ 3281:57711e9aac15

[xemacs-hg @ 2006-03-14 00:09:02 by vins] Check for package hierarchies in siblings to the install directory on Windows.
author vins
date Tue, 14 Mar 2006 00:09:09 +0000
parents f4e405a9d18d
children ccceded4ee72
comparison
equal deleted inserted replaced
3280:60e2e8d7d7dc 3281:57711e9aac15
100 "lib" 100 "lib"
101 (construct-emacs-version-name)))) 101 (construct-emacs-version-name))))
102 ;; in-place or windows-nt 102 ;; in-place or windows-nt
103 (and 103 (and
104 (paths-file-readable-directory-p (paths-construct-path (list directory "lisp"))) 104 (paths-file-readable-directory-p (paths-construct-path (list directory "lisp")))
105 (paths-file-readable-directory-p (paths-construct-path (list directory "etc")))))) 105 (paths-file-readable-directory-p (paths-construct-path (list directory "etc"))))
106 106
107 (defun paths-find-emacs-root (invocation-directory invocation-name) 107 ;; searching for a package directory
108 "Find the run-time root of XEmacs. 108 (and
109 (string-match "win32" system-configuration)
110 (paths-file-readable-directory-p (paths-construct-path (list directory
111 "xemacs-packages"))))))
112
113 (defun paths-find-invocation-roots (invocation-directory invocation-name root-p)
114 "Find the list of run-time roots of XEmacs.
109 INVOCATION-DIRECTORY is a directory containing the XEmacs executable. 115 INVOCATION-DIRECTORY is a directory containing the XEmacs executable.
110 INVOCATION-NAME is the name of the executable itself." 116 INVOCATION-NAME is the name of the executable itself
117 ROOT-P is a function that tests whether a root is plausible."
111 (let* ((executable-file-name (paths-chase-symlink 118 (let* ((executable-file-name (paths-chase-symlink
112 (concat invocation-directory 119 (concat invocation-directory
113 invocation-name))) 120 invocation-name)))
114 (executable-directory (file-name-directory executable-file-name)) 121 (executable-directory (file-name-directory executable-file-name))
115 (maybe-root-1 (file-name-as-directory 122 (maybe-root-1 (file-name-as-directory
116 (paths-construct-path '("..") executable-directory))) 123 (paths-construct-path '("..") executable-directory)))
117 (maybe-root-2 (file-name-as-directory 124 (maybe-root-2 (file-name-as-directory
118 (paths-construct-path '(".." "..") executable-directory)))) 125 (paths-construct-path '(".." "..") executable-directory))))
119 (or (and (paths-emacs-root-p maybe-root-1) 126
120 maybe-root-1) 127 (paths-filter root-p
121 (and (paths-emacs-root-p maybe-root-2) 128 (list maybe-root-1 maybe-root-2))))
122 maybe-root-2))))
123 129
124 (defun paths-find-emacs-roots (invocation-directory 130 (defun paths-find-emacs-roots (invocation-directory
125 invocation-name 131 invocation-name
126 root-p) 132 root-p)
127 "Find all plausible installation roots for XEmacs. 133 "Find all plausible installation roots for XEmacs.
128 This is a list of plausible directories in which to search for the important 134 This is a list of plausible directories in which to search for the important
129 directories used by XEmacs at run-time, for example `exec-directory', 135 directories used by XEmacs at run-time, for example `exec-directory',
130 `data-directory' and `lisp-directory'. 136 `data-directory' and `lisp-directory'.
131 ROOT-P is a function that tests whether a root is plausible." 137 ROOT-P is a function that tests whether a root is plausible."
132 (let* ((potential-invocation-root 138 (let* ((invocation-roots
133 (paths-find-emacs-root invocation-directory invocation-name)) 139 (paths-find-invocation-roots invocation-directory
134 (invocation-roots 140 invocation-name
135 (and potential-invocation-root 141 root-p))
136 (list potential-invocation-root)))
137 (potential-installation-roots 142 (potential-installation-roots
138 (paths-uniq-append 143 (paths-uniq-append
139 (and configure-exec-prefix-directory 144 (and configure-exec-prefix-directory
140 (list (file-name-as-directory 145 (list (file-name-as-directory
141 configure-exec-prefix-directory))) 146 configure-exec-prefix-directory)))