comparison lisp/setup-paths.el @ 276:6330739388db r21-0b36

Import from CVS: tag r21-0b36
author cvs
date Mon, 13 Aug 2007 10:30:37 +0200
parents ca9a9ec9c1c1
children 90d73dddcdc4
comparison
equal deleted inserted replaced
275:a68ae4439f57 276:6330739388db
36 36
37 ;; It requires find-paths.el and packages.el. 37 ;; It requires find-paths.el and packages.el.
38 38
39 ;;; Code: 39 ;;; Code:
40 40
41 (defvar paths-load-path-depth 1
42 "Depth of load-path searches in core Lisp paths.")
43
44 (defvar paths-default-info-directories
45 (list (paths-construct-path '("usr" "local" "info")
46 (char-to-string directory-sep-char))
47 (paths-construct-path '("usr" "info")
48 (char-to-string directory-sep-char)))
49 "Directories appended to the end of the info path by default.")
50
41 (defun paths-find-site-lisp-directory (roots) 51 (defun paths-find-site-lisp-directory (roots)
42 "Find the site Lisp directory of the XEmacs hierarchy." 52 "Find the site Lisp directory of the XEmacs hierarchy."
43 (paths-find-site-directory roots "site-lisp" 53 (paths-find-site-directory roots "site-lisp"
44 nil 54 nil
45 configure-site-directory)) 55 configure-site-directory))
50 nil 60 nil
51 configure-lisp-directory)) 61 configure-lisp-directory))
52 62
53 (defun paths-construct-load-path 63 (defun paths-construct-load-path
54 (roots early-package-load-path late-package-load-path last-package-load-path 64 (roots early-package-load-path late-package-load-path last-package-load-path
55 &optional inhibit-site-lisp) 65 lisp-directory
66 &optional site-lisp-directory)
56 "Construct the load path." 67 "Construct the load path."
57 (let* ((envvar-value (getenv "EMACSLOADPATH")) 68 (let* ((envvar-value (getenv "EMACSLOADPATH"))
58 (env-load-path (and envvar-value 69 (env-load-path
59 (decode-path-internal envvar-value))) 70 (and envvar-value
60 (site-lisp-directory 71 (paths-decode-directory-path envvar-value 'drop-empties)))
61 (and (null inhibit-site-lisp)
62 (paths-find-site-lisp-directory roots)))
63 (site-lisp-load-path 72 (site-lisp-load-path
64 (and site-lisp-directory 73 (and site-lisp-directory
65 (paths-find-recursive-load-path (list site-lisp-directory)))) 74 (paths-find-recursive-load-path (list site-lisp-directory)
66 (lisp-directory (paths-find-lisp-directory roots)) 75 paths-load-path-depth)))
67 (lisp-load-path 76 (lisp-load-path
68 (and lisp-directory 77 (paths-find-recursive-load-path (list lisp-directory)
69 (paths-find-recursive-load-path (list lisp-directory))))) 78 paths-load-path-depth)))
70 (append env-load-path 79 (append env-load-path
71 early-package-load-path 80 early-package-load-path
72 site-lisp-load-path 81 site-lisp-load-path
73 late-package-load-path 82 late-package-load-path
74 lisp-load-path 83 lisp-load-path
87 (list info-directory))) 96 (list info-directory)))
88 (packages-find-package-info-path early-packages) 97 (packages-find-package-info-path early-packages)
89 (packages-find-package-info-path late-packages) 98 (packages-find-package-info-path late-packages)
90 (packages-find-package-info-path last-packages) 99 (packages-find-package-info-path last-packages)
91 (and info-path-envval 100 (and info-path-envval
92 (decode-path-internal info-path-envval))) 101 (paths-decode-directory-path info-path-envval 'drop-empties)))
93 (and (not info-path-envval) 102 (and (not info-path-envval)
94 (paths-uniq-append 103 (paths-uniq-append
95 (paths-directories-which-exist configure-info-path) 104 (paths-directories-which-exist configure-info-path)
96 (paths-directories-which-exist '("/usr/local/info/" "/usr/info/"))))))) 105 (paths-directories-which-exist paths-default-info-directories))))))
97 106
98 (defun paths-find-doc-directory (roots) 107 (defun paths-find-doc-directory (roots)
99 "Find the documentation directory." 108 "Find the documentation directory."
100 (paths-find-architecture-directory roots "lib-src")) 109 (paths-find-architecture-directory roots "lib-src"))
101 110
114 (t 123 (t
115 (expand-file-name "!!!SuperLock!!!" lock-directory)))) 124 (expand-file-name "!!!SuperLock!!!" lock-directory))))
116 125
117 (defun paths-find-exec-directory (roots) 126 (defun paths-find-exec-directory (roots)
118 "Find the binary directory." 127 "Find the binary directory."
119 (paths-find-architecture-directory roots "lib-src")) 128 (paths-find-architecture-directory roots "lib-src" configure-exec-directory))
120 129
121 (defun paths-construct-exec-path (roots exec-directory 130 (defun paths-construct-exec-path (roots exec-directory
122 early-packages late-packages last-packages) 131 early-packages late-packages last-packages)
123 "Find the binary path." 132 "Find the binary path."
124 (append 133 (append
125 (let ((path-envval (getenv "PATH"))) 134 (let ((path-envval (getenv "PATH")))
126 (if path-envval 135 (if path-envval
127 (decode-path-internal path-envval))) 136 (paths-decode-directory-path path-envval 'drop-empties)))
128 (packages-find-package-exec-path early-packages) 137 (packages-find-package-exec-path early-packages)
129 (packages-find-package-exec-path late-packages) 138 (packages-find-package-exec-path late-packages)
130 (packages-find-package-exec-path last-packages) 139 (packages-find-package-exec-path last-packages)
131 (let ((emacspath-envval (getenv "EMACSPATH"))) 140 (let ((emacspath-envval (getenv "EMACSPATH")))
132 (if emacspath-envval 141 (and emacspath-envval
133 (decode-path-internal emacspath-envval) 142 (decode-path-internal emacspath-envval)))
134 (paths-directories-which-exist configure-exec-path)))
135 (and exec-directory 143 (and exec-directory
136 (list exec-directory)))) 144 (list exec-directory))))
137 145
138 (defun paths-find-data-directory (roots) 146 (defun paths-find-data-directory (roots)
139 "Find the data directory." 147 "Find the data directory."