comparison lisp/make-docfile.el @ 5118:e0db3c197671 ben-lisp-object

merge up to latest default branch, doesn't compile yet
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:18:49 -0600
parents ab9e8f0fb295
children 788c38f20376
comparison
equal deleted inserted replaced
5117:3742ea8250b5 5118:e0db3c197671
43 (defvar docfile nil) 43 (defvar docfile nil)
44 (defvar docfile-buffer nil) 44 (defvar docfile-buffer nil)
45 (defvar site-file-list nil) 45 (defvar site-file-list nil)
46 (defvar docfile-out-of-date nil) 46 (defvar docfile-out-of-date nil)
47 47
48 (defvar build-root (expand-file-name ".." invocation-directory)) 48 (defvar build-directory (expand-file-name ".." invocation-directory))
49 (defvar build-lib-src (expand-file-name "lib-src" build-root)) 49 (defvar build-lib-src (expand-file-name "lib-src" build-directory))
50 (defvar source-lisp (file-name-directory (expand-file-name 50 (defvar source-lisp (file-name-directory (expand-file-name
51 (nth 2 command-line-args)))) 51 (nth 2 command-line-args))))
52 (defvar source-src (expand-file-name "../src" source-lisp)) 52 (defvar source-src (expand-file-name "../src" source-lisp))
53 53
54 (defun message (fmt &rest args) 54 (defun message (fmt &rest args)
149 (load "find-paths.el") 149 (load "find-paths.el")
150 (load "packages.el") 150 (load "packages.el")
151 (load "setup-paths.el") 151 (load "setup-paths.el")
152 (load "raw-process.el") 152 (load "raw-process.el")
153 153
154 (let (preloaded-file-list) 154 (let (preloaded-file-list arg0 arg package-preloaded-file-list absolute)
155 (load (expand-file-name "dumped-lisp.el" source-lisp)) 155 (load (expand-file-name "dumped-lisp.el" source-lisp))
156 156
157 (let ((package-preloaded-file-list 157 (setq package-preloaded-file-list
158 (packages-collect-package-dumped-lisps late-package-load-path))) 158 (packages-collect-package-dumped-lisps late-package-load-path)
159 159 preloaded-file-list
160 (setq preloaded-file-list 160 (append package-preloaded-file-list
161 (append package-preloaded-file-list 161 preloaded-file-list
162 preloaded-file-list 162 packages-hardcoded-lisp)
163 packages-hardcoded-lisp))) 163
164 processed (cons "-d" processed)
165 processed (cons source-lisp processed)
166 ;; Include loadup.el, which is never in preloaded-file-list:
167 processed (cons "loadup.el" processed))
164 168
165 (while preloaded-file-list 169 (while preloaded-file-list
166 (let ((arg0 (packages-add-suffix (car preloaded-file-list))) 170 (setq arg0 (packages-add-suffix (car preloaded-file-list))
167 arg) 171 arg (locate-library arg0)
168 (setq arg (locate-library arg0)) 172 absolute arg)
169 (if (null arg) 173 (if (null arg)
170 (progn 174 (progn
171 (message "Error: dumped file %s does not exist" arg0) 175 (message "Error: dumped file %s does not exist" arg0)
172 ;; Uncomment in case of difficulties 176 ;; Uncomment in case of difficulties
173 ;;(message "late-package-hierarchies: %S" late-package-hierarchies) 177 ;(message "late-package-hierarchies: %S"
174 ;;(message "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-root-p)) 178 ; late-package-hierarchies)
175 ;;(message "guessed-data-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-data-root-p)) 179 ;(message "guessed-roots: %S" (paths-find-emacs-roots
176 ) 180 ; invocation-directory
177 (if (null (member arg processed)) 181 ; invocation-name
178 (progn 182 ; #'paths-emacs-root-p))
179 (if (and (null docfile-out-of-date) 183 ;(message "guessed-data-roots: %S" (paths-find-emacs-roots
180 (file-newer-than-file-p arg docfile)) 184 ; invocation-directory
181 (setq docfile-out-of-date t)) 185 ; invocation-name
182 (setq processed (cons arg processed))))) 186 ; #'paths-emacs-data-root-p))
183 (setq preloaded-file-list (cdr preloaded-file-list))))) 187 )
188 (when (equal arg (expand-file-name arg0 source-lisp))
189 ;; Use relative paths where possible, since this makes file lookup
190 ;; in an installed XEmacs easier:
191 (setq arg arg0))
192 (if (null (member arg processed))
193 (progn
194 (if (and (null docfile-out-of-date)
195 ;; We need to check the absolute path here:
196 (file-newer-than-file-p absolute docfile))
197 (setq docfile-out-of-date t))
198 (setq processed (cons arg processed)))))
199 (setq preloaded-file-list (cdr preloaded-file-list))))
184 200
185 ;; Finally process the list of site-loaded files. 201 ;; Finally process the list of site-loaded files.
186 (if site-file-list 202 (if site-file-list
187 (let (site-load-packages) 203 (let (site-load-packages)
188 (load site-file-list t t) 204 (load site-file-list t t)