Mercurial > hg > xemacs-beta
comparison lisp/find-paths.el @ 1227:5636ae1c0234
[xemacs-hg @ 2003-01-22 20:31:52 by michaels]
2003-01-19 Mike Sperber <mike@xemacs.org>
* startup.el (normal-top-level): Compute `emacs-data-roots.' Call
`startup-setup-paths' with data-roots argument.
(emacs-data-roots): Add.
* dump-paths.el: Call `startup-setup-paths' with
data-roots argument.
(startup-setup-paths): Use `data-roots' instead of `roots' to find
packages.
Call `paths-find-emacs-roots' with `root-p' argument.
* make-docfile.el: Call `paths-find-emacs-roots' with `root-p' argument.
* find-paths.el (paths-emacs-data-root-p): Add.
(paths-find-emacs-roots): Parmeterize over `root-p.'
author | michaels |
---|---|
date | Wed, 22 Jan 2003 20:31:52 +0000 |
parents | ceedb6eeaba8 |
children | 4542b72c005e |
comparison
equal
deleted
inserted
replaced
1226:440b3dcb60ed | 1227:5636ae1c0234 |
---|---|
98 "Construct a recursive load path underneath DIRECTORIES." | 98 "Construct a recursive load path underneath DIRECTORIES." |
99 (paths-find-recursive-path directories | 99 (paths-find-recursive-path directories |
100 max-depth paths-no-lisp-directory-regexp)) | 100 max-depth paths-no-lisp-directory-regexp)) |
101 | 101 |
102 (defun paths-emacs-root-p (directory) | 102 (defun paths-emacs-root-p (directory) |
103 "Check if DIRECTORY is a plausible installation root for XEmacs." | 103 "Check if DIRECTORY is a plausible installation root." |
104 (or | 104 (or |
105 ;; installed | 105 ;; installed |
106 (paths-file-readable-directory-p (paths-construct-path (list directory | |
107 "lib" | |
108 (construct-emacs-version-name)))) | |
109 ;; in-place or windows-nt | |
110 (and | |
111 (paths-file-readable-directory-p (paths-construct-path (list directory "lisp"))) | |
112 (paths-file-readable-directory-p (paths-construct-path (list directory "etc")))))) | |
113 | |
114 (defun paths-emacs-data-root-p (directory) | |
115 "Check if DIRECTORY is a plausible data installation root. | |
116 A data installation root is one containing data files that may be shared | |
117 among multiple different versions of XEmacs, the packages in particular." | |
118 (or | |
119 ;; installed | |
120 (paths-file-readable-directory-p (paths-construct-path (list directory | |
121 "lib" | |
122 emacs-program-name))) | |
106 (paths-file-readable-directory-p (paths-construct-path (list directory | 123 (paths-file-readable-directory-p (paths-construct-path (list directory |
107 "lib" | 124 "lib" |
108 (construct-emacs-version-name)))) | 125 (construct-emacs-version-name)))) |
109 ;; in-place or windows-nt | 126 ;; in-place or windows-nt |
110 (and | 127 (and |
280 (null (string-equal "" component))) | 297 (null (string-equal "" component))) |
281 directories) | 298 directories) |
282 directories))) | 299 directories))) |
283 | 300 |
284 (defun paths-find-emacs-roots (invocation-directory | 301 (defun paths-find-emacs-roots (invocation-directory |
285 invocation-name) | 302 invocation-name |
286 "Find all plausible installation roots for XEmacs." | 303 root-p) |
304 "Find all plausible installation roots for XEmacs. | |
305 INVOCATION-DIRECTORY is the directory from which XEmacs was started. | |
306 INVOCATION-NAME is the name of the XEmacs executable that was originally | |
307 started. | |
308 ROOT-P is a function that tests whether a root is plausible." | |
287 (let* ((potential-invocation-root | 309 (let* ((potential-invocation-root |
288 (paths-find-emacs-root invocation-directory invocation-name)) | 310 (paths-find-emacs-root invocation-directory invocation-name)) |
289 (invocation-roots | 311 (invocation-roots |
290 (and potential-invocation-root | 312 (and potential-invocation-root |
291 (list potential-invocation-root))) | 313 (list potential-invocation-root))) |
296 configure-exec-prefix-directory))) | 318 configure-exec-prefix-directory))) |
297 (and configure-prefix-directory | 319 (and configure-prefix-directory |
298 (list (file-name-as-directory | 320 (list (file-name-as-directory |
299 configure-prefix-directory))))) | 321 configure-prefix-directory))))) |
300 (installation-roots | 322 (installation-roots |
301 (paths-filter #'paths-emacs-root-p potential-installation-roots))) | 323 (paths-filter root-p potential-installation-roots))) |
302 (paths-uniq-append invocation-roots | 324 (paths-uniq-append invocation-roots |
303 installation-roots))) | 325 installation-roots))) |
304 | 326 |
305 ;;; find-paths.el ends here | 327 ;;; find-paths.el ends here |