428
|
1 ;;; setup-paths.el --- setup various XEmacs paths
|
|
2
|
|
3 ;; Copyright (C) 1985-1986, 1990, 1992-1997 Free Software Foundation, Inc.
|
|
4 ;; Copyright (c) 1993, 1994 Sun Microsystems, Inc.
|
|
5 ;; Copyright (C) 1995 Board of Trustees, University of Illinois
|
1330
|
6 ;; Copyright (C) 2003 Ben Wing.
|
428
|
7
|
|
8 ;; Author: Mike Sperber <sperber@informatik.uni-tuebingen.de>
|
|
9 ;; Maintainer: XEmacs Development Team
|
|
10 ;; Keywords: internal, dumped
|
|
11
|
|
12 ;; This file is part of XEmacs.
|
|
13
|
|
14 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
15 ;; under the terms of the GNU General Public License as published by
|
|
16 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
17 ;; any later version.
|
|
18
|
|
19 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
22 ;; General Public License for more details.
|
|
23
|
|
24 ;; You should have received a copy of the GNU General Public License
|
|
25 ;; along with XEmacs; see the file COPYING. If not, write to the
|
|
26 ;; Free Software Foundation, 59 Temple Place - Suite 330,
|
|
27 ;; Boston, MA 02111-1307, USA.
|
|
28
|
|
29 ;;; Synched up with: Not in FSF.
|
|
30
|
|
31 ;;; Commentary:
|
|
32
|
|
33 ;; This file is dumped with XEmacs.
|
|
34
|
776
|
35 ;; This file contains functions and variables that describe and construct
|
|
36 ;; the various paths into the XEmacs hierarchy from a global viewpoint.
|
|
37 ;; This file doesn't actually do anything.
|
428
|
38
|
|
39 ;; It requires find-paths.el and packages.el.
|
1330
|
40
|
|
41 ;;; Code:
|
|
42
|
|
43 ;(setq debug-paths t)
|
|
44
|
428
|
45
|
1330
|
46 ;;; Path-related variables.
|
|
47 ;;; NOTE: Many of them (`lisp-directory', `data-directory', etc.) are
|
|
48 ;;; built-in.
|
|
49
|
|
50 (defvar emacs-roots nil
|
|
51 "List of plausible roots of the XEmacs hierarchy.
|
|
52 This is a list of plausible directories in which to search for the important
|
|
53 directories used by XEmacs at run-time, for example `exec-directory',
|
|
54 `data-directory' and `lisp-directory'.
|
|
55
|
|
56 Normally set at startup by calling `paths-find-emacs-roots'.")
|
|
57
|
|
58 (defvar emacs-data-roots nil
|
|
59 "List of plausible data roots of the XEmacs hierarchy.")
|
|
60
|
|
61 (defvar user-init-directory-base ".xemacs"
|
|
62 "Base of directory where user-installed init files may go.")
|
|
63
|
|
64 (defvar user-init-directory
|
|
65 (file-name-as-directory
|
|
66 (paths-construct-path (list "~" user-init-directory-base)))
|
|
67 "Directory where user-installed init files may go.")
|
|
68
|
|
69 (defvar user-init-file-base "init.el"
|
|
70 "Default name of the user init file if uncompiled.
|
|
71 This should be used for migration purposes only.")
|
|
72
|
|
73 (defvar user-init-file-base-list '("init.el")
|
|
74 "List of allowed init files in the user's init directory.
|
|
75 The first one found takes precedence. .elc files do not need to be listed.")
|
|
76
|
|
77 (defvar user-home-init-file-base-list
|
|
78 (append '(".emacs.el" ".emacs")
|
|
79 (and (eq system-type 'windows-nt)
|
|
80 '("_emacs.el" "_emacs")))
|
|
81 "List of allowed init files in the user's home directory.
|
|
82 The first one found takes precedence. .elc files do not need to be listed.")
|
|
83
|
|
84 (defvar load-home-init-file nil
|
|
85 "Non-nil if XEmacs should load the init file from the home directory.
|
|
86 Otherwise, XEmacs will offer migration to the init directory.")
|
|
87
|
|
88 (defvar load-user-init-file-p t
|
|
89 "Non-nil if XEmacs should load the user's init file.")
|
428
|
90
|
460
|
91 (defvar paths-core-load-path-depth 0
|
428
|
92 "Depth of load-path searches in core Lisp paths.")
|
|
93
|
452
|
94 (defvar paths-site-load-path-depth 1
|
|
95 "Depth of load-path searches in site Lisp paths.")
|
|
96
|
460
|
97 (defvar paths-mule-load-path-depth 0
|
|
98 "Depth of load-path searches in Mule Lisp paths.")
|
|
99
|
428
|
100 (defvar paths-default-info-directories
|
|
101 (mapcar (function
|
|
102 (lambda (dirlist)
|
|
103 (paths-construct-path
|
|
104 dirlist (char-to-string directory-sep-char))))
|
|
105 '(("usr" "local" "info")
|
|
106 ("usr" "info")
|
|
107 ("usr" "local" "share" "info")
|
|
108 ("usr" "share" "info")))
|
|
109 "Directories appended to the end of the info path by default.")
|
|
110
|
1330
|
111
|
|
112 ;;; Basic utility functions.
|
|
113
|
|
114 (defun paths-emacs-root-p (directory)
|
|
115 "Check if DIRECTORY is a plausible installation root."
|
|
116 (or
|
|
117 ;; installed
|
|
118 (paths-file-readable-directory-p (paths-construct-path (list directory
|
|
119 "lib"
|
|
120 (construct-emacs-version-name))))
|
|
121 ;; in-place or windows-nt. windows-nt equivalent of --srcdir is
|
|
122 ;; BUILD_DIR in config.inc, and has no lisp/ or etc/ since symlinks
|
|
123 ;; don't exist. instead, xemacs.mak points configure-lisp-directory and
|
|
124 ;; configure-data-directory at the right places.
|
|
125 (and
|
1526
|
126 (or configure-exec-directory (paths-file-readable-directory-p (paths-construct-path (list directory "lib-src"))) (eq system-type 'windows-nt))
|
1330
|
127 (or configure-lisp-directory (paths-file-readable-directory-p (paths-construct-path (list directory "lisp"))))
|
|
128 (or configure-data-directory (paths-file-readable-directory-p (paths-construct-path (list directory "etc")))))))
|
|
129
|
|
130 (defun paths-emacs-data-root-p (directory)
|
|
131 "Check if DIRECTORY is a plausible data installation root.
|
|
132 A data installation root is one containing data files that may be shared
|
|
133 among multiple different versions of XEmacs, the packages in particular."
|
|
134 (or
|
|
135 ;; installed
|
|
136 (paths-file-readable-directory-p (paths-construct-path (list directory
|
|
137 "lib"
|
|
138 emacs-program-name)))
|
|
139 (paths-file-readable-directory-p (paths-construct-path (list directory
|
|
140 "lib"
|
|
141 (construct-emacs-version-name))))
|
|
142 ;; in-place or windows-nt
|
|
143 (and
|
|
144 (paths-file-readable-directory-p (paths-construct-path (list directory "lisp")))
|
|
145 (paths-file-readable-directory-p (paths-construct-path (list directory "etc"))))))
|
|
146
|
|
147 (defun paths-find-emacs-root (invocation-directory invocation-name)
|
|
148 "Find the run-time root of XEmacs."
|
|
149 (let* ((executable-file-name (paths-chase-symlink
|
|
150 (concat invocation-directory
|
|
151 invocation-name)))
|
|
152 (executable-directory (file-name-directory executable-file-name))
|
|
153 (maybe-root-1 (file-name-as-directory
|
|
154 (paths-construct-path '("..") executable-directory)))
|
|
155 (maybe-root-2 (file-name-as-directory
|
|
156 (paths-construct-path '(".." "..") executable-directory))))
|
|
157 (or (and (paths-emacs-root-p maybe-root-1)
|
|
158 maybe-root-1)
|
|
159 (and (paths-emacs-root-p maybe-root-2)
|
|
160 maybe-root-2))))
|
|
161
|
|
162 (defun paths-find-emacs-roots (root-p)
|
|
163 "Find all plausible installation roots for XEmacs.
|
|
164 This is a list of plausible directories in which to search for the important
|
|
165 directories used by XEmacs at run-time, for example `exec-directory',
|
|
166 `data-directory' and `lisp-directory'.
|
|
167 ROOT-P is a function that tests whether a root is plausible."
|
|
168 (let* ((potential-invocation-root
|
|
169 (paths-find-emacs-root invocation-directory invocation-name))
|
|
170 (invocation-roots
|
|
171 (and potential-invocation-root
|
|
172 (list potential-invocation-root)))
|
|
173 (potential-installation-roots
|
|
174 (paths-uniq-append
|
|
175 (and configure-exec-prefix-directory
|
|
176 (list (file-name-as-directory
|
|
177 configure-exec-prefix-directory)))
|
|
178 (and configure-prefix-directory
|
|
179 (list (file-name-as-directory
|
|
180 configure-prefix-directory)))))
|
|
181 (installation-roots
|
|
182 (paths-filter root-p potential-installation-roots)))
|
|
183 (paths-uniq-append invocation-roots
|
|
184 installation-roots)))
|
|
185
|
428
|
186 (defun paths-find-site-lisp-directory (roots)
|
|
187 "Find the site Lisp directory of the XEmacs hierarchy."
|
|
188 (paths-find-site-directory roots "site-lisp"
|
|
189 nil
|
|
190 configure-site-directory))
|
|
191
|
|
192 (defun paths-find-site-module-directory (roots)
|
|
193 "Find the site modules directory of the XEmacs hierarchy."
|
|
194 (paths-find-site-directory roots "site-modules"
|
|
195 nil
|
|
196 configure-site-module-directory))
|
|
197
|
|
198 (defun paths-find-lisp-directory (roots)
|
|
199 "Find the main Lisp directory of the XEmacs hierarchy."
|
|
200 (paths-find-version-directory roots "lisp"
|
|
201 nil
|
|
202 configure-lisp-directory))
|
|
203
|
460
|
204 (defun paths-find-mule-lisp-directory (roots &optional lisp-directory)
|
|
205 "Find the Mule Lisp directory of the XEmacs hierarchy."
|
|
206 ;; #### kludge
|
|
207 (if lisp-directory
|
|
208 (let ((guess
|
|
209 (file-name-as-directory
|
|
210 (paths-construct-path (list lisp-directory "mule")))))
|
|
211 (if (paths-file-readable-directory-p guess)
|
|
212 guess
|
|
213 (paths-find-version-directory roots "mule-lisp"
|
|
214 nil
|
|
215 configure-mule-lisp-directory)))))
|
|
216
|
428
|
217 (defun paths-find-module-directory (roots)
|
|
218 "Find the main modules directory of the XEmacs hierarchy."
|
|
219 (paths-find-architecture-directory roots "modules"
|
|
220 nil configure-module-directory))
|
|
221
|
|
222 (defun paths-construct-load-path
|
|
223 (roots early-package-load-path late-package-load-path last-package-load-path
|
|
224 lisp-directory
|
460
|
225 &optional site-lisp-directory mule-lisp-directory)
|
428
|
226 "Construct the load path."
|
|
227 (let* ((envvar-value (getenv "EMACSLOADPATH"))
|
|
228 (env-load-path
|
|
229 (and envvar-value
|
|
230 (paths-decode-directory-path envvar-value 'drop-empties)))
|
|
231 (site-lisp-load-path
|
|
232 (and site-lisp-directory
|
|
233 (paths-find-recursive-load-path (list site-lisp-directory)
|
452
|
234 paths-site-load-path-depth)))
|
460
|
235 (mule-lisp-load-path
|
|
236 (and mule-lisp-directory
|
|
237 (paths-find-recursive-load-path (list mule-lisp-directory)
|
|
238 paths-mule-load-path-depth)))
|
428
|
239 (lisp-load-path
|
|
240 (and lisp-directory
|
|
241 (paths-find-recursive-load-path (list lisp-directory)
|
452
|
242 paths-core-load-path-depth))))
|
428
|
243 (append env-load-path
|
|
244 early-package-load-path
|
|
245 site-lisp-load-path
|
|
246 late-package-load-path
|
460
|
247 mule-lisp-load-path
|
428
|
248 lisp-load-path
|
|
249 last-package-load-path)))
|
|
250
|
|
251 (defun paths-construct-module-load-path
|
|
252 (root module-directory &optional site-module-directory)
|
|
253 "Construct the modules load path."
|
|
254 (let* ((envvar-value (getenv "EMACSMODULEPATH"))
|
|
255 (env-module-path
|
|
256 (and envvar-value
|
|
257 (paths-decode-directory-path envvar-value 'drop-empties)))
|
|
258 (site-module-load-path
|
|
259 (and site-module-directory
|
|
260 (paths-find-recursive-load-path (list site-module-directory)
|
452
|
261 paths-site-load-path-depth)))
|
428
|
262 (module-load-path
|
|
263 (and module-directory
|
|
264 (paths-find-recursive-load-path (list module-directory)
|
452
|
265 paths-core-load-path-depth))))
|
428
|
266 (append env-module-path
|
|
267 site-module-load-path
|
|
268 module-load-path)))
|
|
269
|
|
270 (defun paths-construct-info-path (roots early-packages late-packages last-packages)
|
|
271 "Construct the info path."
|
|
272 (let ((info-path-envval (getenv "INFOPATH")))
|
|
273 (paths-uniq-append
|
|
274 (append
|
|
275 (let ((info-directory
|
|
276 (paths-find-version-directory roots "info"
|
|
277 nil
|
|
278 configure-info-directory)))
|
|
279 (and info-directory
|
|
280 (list info-directory)))
|
|
281 (packages-find-package-info-path early-packages)
|
|
282 (packages-find-package-info-path late-packages)
|
|
283 (packages-find-package-info-path last-packages)
|
|
284 (and info-path-envval
|
|
285 (paths-decode-directory-path info-path-envval 'drop-empties)))
|
|
286 (and (null info-path-envval)
|
|
287 (paths-uniq-append
|
|
288 (paths-directories-which-exist configure-info-path)
|
|
289 (paths-directories-which-exist paths-default-info-directories))))))
|
|
290
|
|
291 (defun paths-find-doc-directory (roots)
|
|
292 "Find the documentation directory."
|
|
293 (paths-find-architecture-directory roots "lib-src" nil configure-doc-directory))
|
|
294
|
|
295 (defun paths-find-exec-directory (roots)
|
|
296 "Find the binary directory."
|
|
297 (paths-find-architecture-directory roots "lib-src"
|
|
298 nil configure-exec-directory))
|
|
299
|
|
300 (defun paths-construct-exec-path (roots exec-directory
|
|
301 early-packages late-packages last-packages)
|
|
302 "Find the binary path."
|
|
303 (append
|
|
304 (let ((path-envval (getenv "PATH")))
|
|
305 (if path-envval
|
|
306 (paths-decode-directory-path path-envval 'drop-empties)))
|
|
307 (packages-find-package-exec-path early-packages)
|
|
308 (packages-find-package-exec-path late-packages)
|
|
309 (let ((emacspath-envval (getenv "EMACSPATH")))
|
|
310 (and emacspath-envval
|
|
311 (split-path emacspath-envval)))
|
|
312 (and exec-directory
|
|
313 (list exec-directory))
|
|
314 (packages-find-package-exec-path last-packages)))
|
|
315
|
|
316 (defun paths-find-data-directory (roots)
|
|
317 "Find the data directory."
|
|
318 (paths-find-version-directory roots "etc" "EMACSDATA" configure-data-directory))
|
|
319
|
|
320 (defun paths-construct-data-directory-list (data-directory
|
|
321 early-packages late-packages last-packages)
|
|
322 "Find the data path."
|
|
323 (append
|
|
324 (packages-find-package-data-path early-packages)
|
|
325 (packages-find-package-data-path late-packages)
|
|
326 (list data-directory)
|
|
327 (packages-find-package-data-path last-packages)))
|
|
328
|
1330
|
329
|
|
330 ;;; High-level functions to set up the paths.
|
|
331
|
|
332 (defun startup-find-load-path (&optional inhibit-packages
|
|
333 set-global-package-paths)
|
|
334 "Determine the value for `load-path'.
|
|
335 INHIBIT-PACKAGES says which types of packages, if any, to omit from the
|
|
336 returned value. It can be `t' (omit all), one of the symbols `early',
|
|
337 `late', or `last', or a list of one or more of the symbols.
|
|
338
|
|
339 If SET-GLOBAL-PACKAGE-PATHS is non-nil, initialize the global package path
|
|
340 variables referring to the particular types of packages (`early-packages',
|
|
341 `early-package-load-path', `late-packages', `late-package-load-path',
|
|
342 `last-packages', `last-package-load-path')."
|
|
343 (let (earlyp latep lastp earlyp-lp latep-lp lastp-lp)
|
|
344 (apply #'(lambda (early late last)
|
|
345 (setq earlyp (and (not (memq 'early inhibit-packages)) early))
|
|
346 (setq latep (and (not (memq 'late inhibit-packages)) late))
|
|
347 (setq lastp (and (not (memq 'last inhibit-packages)) last)))
|
|
348 (packages-find-packages
|
|
349 emacs-data-roots
|
|
350 (packages-compute-package-locations user-init-directory)))
|
|
351
|
|
352 (setq earlyp-lp (packages-find-package-load-path earlyp))
|
|
353 (setq latep-lp (packages-find-package-load-path latep))
|
|
354 (setq lastp-lp (packages-find-package-load-path lastp))
|
|
355
|
|
356 (when set-global-package-paths
|
|
357 (setq early-packages earlyp
|
|
358 late-packages latep
|
|
359 last-packages lastp
|
|
360 early-package-load-path earlyp-lp
|
|
361 late-package-load-path latep-lp
|
|
362 last-package-load-path lastp-lp))
|
|
363
|
|
364 (paths-construct-load-path emacs-roots earlyp-lp latep-lp lastp-lp
|
|
365 lisp-directory site-directory
|
|
366 mule-lisp-directory)))
|
|
367
|
|
368 (defun startup-setup-paths (&optional inhibit-packages called-early)
|
|
369 "Setup all the various paths.
|
|
370 INHIBIT-PACKAGES says which types of packages, if any, to omit from the
|
|
371 returned value. It can be `t' (omit all), one of the symbols `early',
|
|
372 `late', or `last', or a list of one or more of the symbols.
|
|
373
|
|
374 This function is idempotent, so call this as often as you like!"
|
|
375
|
|
376 (setq debug-paths (or debug-paths
|
|
377 (and (getenv "EMACSDEBUGPATHS")
|
|
378 t)))
|
|
379
|
|
380 (setq emacs-roots (paths-find-emacs-roots #'paths-emacs-data-root-p))
|
|
381
|
|
382 (setq emacs-data-roots (paths-find-emacs-roots #'paths-emacs-data-root-p))
|
|
383
|
|
384 (if (null emacs-roots)
|
|
385 (save-excursion
|
|
386 (set-buffer (get-buffer-create " *warning-tmp*"))
|
|
387 (erase-buffer)
|
|
388 (buffer-disable-undo (current-buffer))
|
|
389
|
|
390 (insert "Couldn't find an obvious default for the root of the\n"
|
|
391 "XEmacs hierarchy.")
|
|
392
|
|
393 (princ "\nWARNING:\n" 'external-debugging-output)
|
|
394 (princ (buffer-string) 'external-debugging-output)))
|
|
395
|
|
396 (if (eq inhibit-packages t)
|
|
397 (setq inhibit-packages '(early late last)))
|
|
398 (if (not (listp inhibit-packages))
|
|
399 (setq inhibit-packages (list inhibit-packages)))
|
|
400
|
|
401 (when debug-paths
|
|
402 (princ (format
|
|
403 "startup-setup-paths arguments:
|
|
404 inhibit-packages: %S
|
|
405 inhibit-site-lisp: %S
|
|
406 called-early: %S
|
|
407 " inhibit-packages inhibit-site-lisp called-early)
|
|
408 'external-debugging-output)
|
|
409 (princ (format
|
|
410 "emacs-roots:
|
|
411 %S
|
|
412 emacs-data-roots:
|
|
413 %S
|
|
414 user-init-directory: %S
|
|
415 configure-package-path: %S
|
|
416 " emacs-roots emacs-data-roots user-init-directory configure-package-path)
|
|
417 'external-debugging-output)
|
|
418 )
|
|
419
|
|
420 (setq lisp-directory (paths-find-lisp-directory emacs-roots))
|
|
421
|
|
422 (if debug-paths
|
|
423 (princ (format "lisp-directory:\n%S\n" lisp-directory)
|
|
424 'external-debugging-output))
|
|
425
|
|
426 (if (featurep 'mule)
|
|
427 (progn
|
|
428 (setq mule-lisp-directory
|
|
429 (paths-find-mule-lisp-directory emacs-roots
|
|
430 lisp-directory))
|
|
431 (if debug-paths
|
|
432 (princ (format "mule-lisp-directory:\n%S\n"
|
|
433 mule-lisp-directory)
|
|
434 'external-debugging-output)))
|
|
435 (setq mule-lisp-directory '()))
|
|
436
|
|
437 (setq site-directory (and (null inhibit-site-lisp)
|
|
438 (paths-find-site-lisp-directory emacs-roots)))
|
|
439
|
|
440 (if (and debug-paths (null inhibit-site-lisp))
|
|
441 (princ (format "site-directory:\n%S\n" site-directory)
|
|
442 'external-debugging-output))
|
|
443
|
|
444 (setq load-path (startup-find-load-path inhibit-packages t))
|
|
445
|
|
446 (when debug-paths
|
|
447 (princ (format "early-packages and early-package-load-path:\n%S\n%S\n"
|
|
448 early-packages early-package-load-path)
|
|
449 'external-debugging-output)
|
|
450 (princ (format "late-packages and late-package-load-path:\n%S\n%S\n"
|
|
451 late-packages late-package-load-path)
|
|
452 'external-debugging-output)
|
|
453 (princ (format "last-packages and last-package-load-path:\n%S\n%S\n"
|
|
454 last-packages last-package-load-path)
|
|
455 'external-debugging-output))
|
|
456
|
|
457 (if debug-paths
|
|
458 (princ (format "load-path:\n%S\n" load-path)
|
|
459 'external-debugging-output))
|
|
460 (setq module-directory (paths-find-module-directory emacs-roots))
|
|
461 (if debug-paths
|
|
462 (princ (format "module-directory:\n%S\n" module-directory)
|
|
463 'external-debugging-output))
|
|
464 (setq site-module-directory (and (null inhibit-site-modules)
|
|
465 (paths-find-site-module-directory
|
|
466 emacs-roots)))
|
|
467 (if (and debug-paths (null inhibit-site-modules))
|
|
468 (princ (format "site-module-directory:\n%S\n"
|
|
469 site-module-directory)
|
|
470 'external-debugging-output))
|
|
471
|
|
472 (setq module-load-path (paths-construct-module-load-path
|
|
473 emacs-roots
|
|
474 module-directory
|
|
475 site-module-directory))
|
|
476
|
|
477 (unless called-early
|
|
478 (setq Info-directory-list
|
|
479 (paths-construct-info-path
|
|
480 emacs-roots early-packages late-packages last-packages))
|
|
481
|
|
482 (if debug-paths
|
|
483 (princ (format "Info-directory-list:\n%S\n" Info-directory-list)
|
|
484 'external-debugging-output))
|
|
485
|
|
486 (setq exec-directory (paths-find-exec-directory emacs-roots))
|
|
487
|
|
488 (if debug-paths
|
|
489 (princ (format "exec-directory:\n%s\n" exec-directory)
|
|
490 'external-debugging-output))
|
|
491
|
|
492 (setq exec-path
|
|
493 (paths-construct-exec-path emacs-roots exec-directory
|
|
494 early-packages late-packages
|
|
495 last-packages))
|
|
496
|
|
497 (if debug-paths
|
|
498 (princ (format "exec-path:\n%S\n" exec-path)
|
|
499 'external-debugging-output))
|
|
500
|
|
501 (setq doc-directory (paths-find-doc-directory emacs-roots))
|
|
502
|
|
503 (if debug-paths
|
|
504 (princ (format "doc-directory:\n%S\n" doc-directory)
|
|
505 'external-debugging-output))
|
|
506
|
|
507 (setq data-directory (paths-find-data-directory emacs-roots))
|
|
508
|
|
509 (if debug-paths
|
|
510 (princ (format "data-directory:\n%S\n" data-directory)
|
|
511 'external-debugging-output))
|
|
512
|
|
513 (setq data-directory-list (paths-construct-data-directory-list
|
|
514 data-directory early-packages
|
|
515 late-packages last-packages))
|
|
516 (if debug-paths
|
|
517 (princ (format "data-directory-list:\n%S\n" data-directory-list)
|
|
518 'external-debugging-output))))
|
|
519
|
|
520 (defun startup-find-load-path-for-packages (packages)
|
|
521 "Return a suitable load-path for PACKAGES.
|
|
522 PACKAGES is a list of package names (strings). This looks for package
|
|
523 directories in the load path whose last component is one of the members of
|
|
524 PACKAGES."
|
|
525 (mapcan
|
|
526 #'(lambda (package)
|
|
527 (and (member (file-name-nondirectory (directory-file-name package))
|
|
528 packages)
|
|
529 (list package)))
|
|
530 (startup-find-load-path)))
|
|
531
|
|
532 ; (defun startup-set-basic-packages-load-path ()
|
|
533 ; "#### This is a hack. When recompiling .el files, we use -no-packages
|
|
534 ; to avoid problems with packages shadowing standard Lisp files
|
|
535 ; (e.g. unicode.el), but we really still need the stuff in xemacs-base and
|
|
536 ; xemacs-devel, which SHOULD NOT be in the packages."
|
|
537 ; (setq load-path (startup-find-load-path-for-packages
|
|
538 ; '("xemacs-base" "xemacs-devel"))))
|
|
539
|
|
540
|
|
541 ;;; Now actually set the paths up, for bootstrapping purposes. This is run
|
|
542 ;;; at early dump time and in certain cases where we use a minimal temacs
|
|
543 ;;; to do useful things, like rebuild DOC.
|
|
544
|
|
545 (startup-setup-paths (if inhibit-all-packages t '(early last)) t)
|
|
546
|
428
|
547 ;;; setup-paths.el ends here
|