comparison lisp/dump-paths.el @ 776:79940b592197

[xemacs-hg @ 2002-03-15 07:43:14 by ben] .cvsignore: ignore .tmp files that are getting auto-created by VC. Makefile.in.in: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). alloc.c, emacs.c, lisp.h: add new -no-packages. make sure list of args for sorting is actually correct. clean up arg parsing code. xemacs.mak: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). Makefile: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). mule\chinese.el, mule\japan-util.el: fix warnings. behavior-defs.el: fix errors with require. bytecomp-runtime.el: add new funs {when,and}-{f}boundp, clean up docs. cus-edit.el: pretty-print values. dump-paths.el, find-paths.el, startup.el, setup-paths.el: fix problems/inconsistencies parsing options. support new -no-packages option. merge code duplication in dump-paths and startup. lisp-mode.el: indent macrolet and labels correctly. update comments about lisp-indent-function. flet already handled in cl. apropos.el, auto-save.el, buff-menu.el, cl-extra.el, dragdrop.el, faces.el, files.el, fill.el, font-lock.el, font.el, gtk-faces.el, gui.el, help.el, hyper-apropos.el, info.el, isearch-mode.el, keymap.el, lisp-mnt.el, mouse.el, package-admin.el, package-get.el, printer.el, process.el, resize-minibuffer.el, simple.el, toolbar-items.el, wid-edit.el, win32-native.el: fix warnings. very-early-lisp.el: update docs. mule\chinese.el, mule\japan-util.el: fix warnings. mule\chinese.el, mule\japan-util.el: fix warnings. behavior-defs.el: fix errors with require. bytecomp-runtime.el: add new funs {when,and}-{f}boundp, clean up docs. cus-edit.el: pretty-print values. dump-paths.el, find-paths.el, startup.el, setup-paths.el: fix problems/inconsistencies parsing options. support new -no-packages option. merge code duplication in dump-paths and startup. lisp-mode.el: indent macrolet and labels correctly. update comments about lisp-indent-function. flet already handled in cl. apropos.el, auto-save.el, buff-menu.el, cl-extra.el, dragdrop.el, faces.el, files.el, fill.el, font-lock.el, font.el, gtk-faces.el, gui.el, help.el, hyper-apropos.el, info.el, isearch-mode.el, keymap.el, lisp-mnt.el, mouse.el, package-admin.el, package-get.el, printer.el, process.el, resize-minibuffer.el, simple.el, toolbar-items.el, wid-edit.el, win32-native.el: fix warnings. very-early-lisp.el: update docs. mule\chinese.el, mule\japan-util.el: fix warnings. Makefile.in.in: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). Makefile.in.in: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs).
author ben
date Fri, 15 Mar 2002 07:43:43 +0000
parents 223736d75acb
children edc95b5fe4cb
comparison
equal deleted inserted replaced
775:7d972c3de90a 776:79940b592197
1 ;; dump-paths.el --- set up XEmacs paths for dumping 1 ;; dump-paths.el --- set up XEmacs paths for dumping
2 2
3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc.
4 ;; Copyright (C) 2002 Ben Wing.
4 5
5 ;; Maintainer: XEmacs Development Team 6 ;; Maintainer: XEmacs Development Team
6 ;; Keywords: internal, dumped 7 ;; Keywords: internal, dumped
7 8
8 ;; This file is part of XEmacs. 9 ;; This file is part of XEmacs.
24 25
25 ;;; Synched up with: Not in FSF 26 ;;; Synched up with: Not in FSF
26 27
27 ;;; Commentary: 28 ;;; Commentary:
28 29
29 ;; This sets up the various paths for continuing loading files for 30 ;; This sets up the various paths for continuing loading files for dumping.
30 ;; dumping. 31 ;; This is the only file of the basic path/package files (find-paths.el,
31 ;; #### This code is duplicated in startup.el (startup-setup-paths). 32 ;; package.el, setup-paths.el, dump-paths.el) that actually does stuff.
32 33
33 (let ((debug-paths (or debug-paths 34 (defun startup-setup-paths (roots user-init-directory
34 (and (getenv "EMACSDEBUGPATHS") 35 &optional
35 t))) 36 inhibit-packages inhibit-site-lisp
36 (roots (paths-find-emacs-roots invocation-directory 37 debug-paths called-early)
37 invocation-name))) 38 "Setup all the various paths.
38 39 ROOTS is a list of plausible roots of the XEmacs directory hierarchy.
39 (if debug-paths 40 If INHIBIT-PACKAGES is non-NIL, don't do packages.
40 (princ (format "XEmacs thinks the roots of its hierarchy are:\n%S\n" 41 If INHIBIT-SITE-LISP is non-NIL, don't do site-lisp.
41 roots))) 42 If DEBUG-PATHS is non-NIL, print paths as they are detected.
42 43 It's idempotent, so call this as often as you like!"
43 (let* ((package-locations 44
44 (packages-compute-package-locations 45 (if (eq inhibit-packages t)
45 ;; temporary kludge: 46 (setq inhibit-packages '(early late last)))
46 ;; this should be synched with startup.el 47 (if (not (listp inhibit-packages))
47 (paths-construct-path '("~" ".xemacs")))) 48 (setq inhibit-packages (list inhibit-packages)))
48 (stuff (packages-find-packages roots package-locations))) 49
49 (setq late-packages (car (cdr stuff)))) 50 (apply #'(lambda (early late last)
50 51 (setq early-packages (and (not (memq 'early inhibit-packages))
52 early))
53 (setq late-packages (and (not (memq 'late inhibit-packages))
54 late))
55 (setq last-packages (and (not (memq 'last inhibit-packages))
56 last))
57 )
58 (packages-find-packages
59 roots
60 (packages-compute-package-locations user-init-directory)))
61
62 (setq early-package-load-path (packages-find-package-load-path
63 early-packages))
51 (setq late-package-load-path (packages-find-package-load-path late-packages)) 64 (setq late-package-load-path (packages-find-package-load-path late-packages))
65 (setq last-package-load-path (packages-find-package-load-path last-packages))
52 66
53 (if debug-paths 67 (if debug-paths
54 (progn 68 (progn
69 (princ (format "arguments:\nroots: %S\nuser-init-directory: %S\n"
70 roots user-init-directory)
71 'external-debugging-output)
72 (princ (format "inhibit-packages: %S\ninhibit-site-lisp: %S\n"
73 inhibit-packages inhibit-site-lisp)
74 'external-debugging-output)
75 (princ (format "debug-paths: %S\ncalled-early: %S\n\n"
76 debug-paths called-early)
77 'external-debugging-output)
55 (princ (format "configure-package-path:\n%S\n" configure-package-path) 78 (princ (format "configure-package-path:\n%S\n" configure-package-path)
79 'external-debugging-output)
80 (princ (format "early-packages and early-package-load-path:\n%S\n%S\n"
81 early-packages early-package-load-path)
56 'external-debugging-output) 82 'external-debugging-output)
57 (princ (format "late-packages and late-package-load-path:\n%S\n%S\n" 83 (princ (format "late-packages and late-package-load-path:\n%S\n%S\n"
58 late-packages late-package-load-path) 84 late-packages late-package-load-path)
85 'external-debugging-output)
86 (princ (format "last-packages and last-package-load-path:\n%S\n%S\n"
87 last-packages last-package-load-path)
59 'external-debugging-output))) 88 'external-debugging-output)))
60 89
61 (setq lisp-directory (paths-find-lisp-directory roots)) 90 (setq lisp-directory (paths-find-lisp-directory roots))
91
62 (if debug-paths 92 (if debug-paths
63 (princ (format "lisp-directory:\n%S\n" lisp-directory) 93 (princ (format "lisp-directory:\n%S\n" lisp-directory)
64 'external-debugging-output)) 94 'external-debugging-output))
95
65 (if (featurep 'mule) 96 (if (featurep 'mule)
66 (progn 97 (progn
67 (setq mule-lisp-directory 98 (setq mule-lisp-directory
68 (paths-find-mule-lisp-directory roots 99 (paths-find-mule-lisp-directory roots
69 lisp-directory)) 100 lisp-directory))
70 (if debug-paths 101 (if debug-paths
71 (princ (format "mule-lisp-directory:\n%S\n" 102 (princ (format "mule-lisp-directory:\n%S\n"
72 mule-lisp-directory) 103 mule-lisp-directory)
73 'external-debugging-output))) 104 'external-debugging-output)))
74 (setq mule-lisp-directory '())) 105 (setq mule-lisp-directory '()))
106
75 (setq site-directory (and (null inhibit-site-lisp) 107 (setq site-directory (and (null inhibit-site-lisp)
76 (paths-find-site-lisp-directory roots))) 108 (paths-find-site-lisp-directory roots)))
109
77 (if (and debug-paths (null inhibit-site-lisp)) 110 (if (and debug-paths (null inhibit-site-lisp))
78 (princ (format "site-directory:\n%S\n" site-directory) 111 (princ (format "site-directory:\n%S\n" site-directory)
79 'external-debugging-output)) 112 'external-debugging-output))
80 113
81 (setq load-path (paths-construct-load-path roots 114 (setq load-path (paths-construct-load-path roots
82 '() 115 early-package-load-path
83 late-package-load-path 116 late-package-load-path
84 '() 117 last-package-load-path
85 lisp-directory 118 lisp-directory
86 site-directory 119 site-directory
87 mule-lisp-directory)) 120 mule-lisp-directory))
88 121
89 (setq module-directory (paths-find-module-directory roots)) 122 (if called-early
123 (progn
124 (setq module-directory (paths-find-module-directory roots))
125 (if debug-paths
126 (princ (format "module-directory:\n%S\n" module-directory)
127 'external-debugging-output))
128 (setq site-module-directory (and (null inhibit-site-modules)
129 (paths-find-site-module-directory
130 roots)))
131 (if (and debug-paths (null inhibit-site-modules))
132 (princ (format "site-module-directory:\n%S\n"
133 site-module-directory)
134 'external-debugging-output))
135
136 (setq module-load-path (paths-construct-module-load-path
137 roots
138 module-directory
139 site-module-directory)))
140 (setq Info-directory-list
141 (paths-construct-info-path
142 roots early-packages late-packages last-packages))
143
144 (if debug-paths
145 (princ (format "Info-directory-list:\n%S\n" Info-directory-list)
146 'external-debugging-output))
147
148 (setq exec-directory (paths-find-exec-directory roots))
149
150 (if debug-paths
151 (princ (format "exec-directory:\n%s\n" exec-directory)
152 'external-debugging-output))
153
154 (setq exec-path
155 (paths-construct-exec-path roots exec-directory
156 early-packages late-packages
157 last-packages))
158
159 (if debug-paths
160 (princ (format "exec-path:\n%S\n" exec-path)
161 'external-debugging-output))
162
163 (setq doc-directory (paths-find-doc-directory roots))
164
165 (if debug-paths
166 (princ (format "doc-directory:\n%S\n" doc-directory)
167 'external-debugging-output))
168
169 (setq data-directory (paths-find-data-directory roots))
170
171 (if debug-paths
172 (princ (format "data-directory:\n%S\n" data-directory)
173 'external-debugging-output))
174
175 (setq data-directory-list (paths-construct-data-directory-list
176 data-directory early-packages
177 late-packages last-packages))
178 (if debug-paths
179 (princ (format "data-directory-list:\n%S\n" data-directory-list)
180 'external-debugging-output))))
181
182 ;;; Now actually do something.
183
184 (let ((debug-paths (or debug-paths
185 (and (getenv "EMACSDEBUGPATHS")
186 t)))
187 (roots (paths-find-emacs-roots invocation-directory
188 invocation-name)))
189
90 (if debug-paths 190 (if debug-paths
91 (princ (format "module-directory:\n%S\n" module-directory) 191 (princ (format "XEmacs thinks the roots of its hierarchy are:\n%S\n"
192 roots)
92 'external-debugging-output)) 193 'external-debugging-output))
93 (setq site-module-directory (and (null inhibit-site-modules) 194 (startup-setup-paths roots
94 (paths-find-site-module-directory roots))) 195 (paths-construct-path '("~" ".xemacs"))
95 (if (and debug-paths (null inhibit-site-modules)) 196 (if inhibit-all-packages t
96 (princ (format "site-module-directory:\n%S\n" site-module-directory) 197 '(early last))
97 'external-debugging-output)) 198 inhibit-site-lisp
98 199 debug-paths
99 (setq module-load-path (paths-construct-module-load-path roots 200 t))
100 module-directory
101 site-module-directory)))
102 201
103 ;;; dump-paths.el ends here 202 ;;; dump-paths.el ends here