428
|
1 ;;; packages.el --- Low level support for XEmacs packages
|
|
2
|
|
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
|
793
|
4 ;; Copyright (C) 2002 Ben Wing.
|
428
|
5
|
|
6 ;; Author: Steven L Baur <steve@xemacs.org>
|
|
7 ;; Maintainer: Steven L Baur <steve@xemacs.org>
|
|
8 ;; Keywords: internal, lisp, dumped
|
|
9
|
|
10 ;; This file is part of XEmacs.
|
|
11
|
|
12 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
13 ;; under the terms of the GNU General Public License as published by
|
|
14 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
15 ;; any later version.
|
|
16
|
|
17 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20 ;; General Public License for more details.
|
|
21
|
|
22 ;; You should have received a copy of the GNU General Public License
|
|
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
25 ;; 02111-1307, USA.
|
|
26
|
|
27 ;;; Synched up with: Not in FSF
|
|
28
|
|
29 ;;; Commentary:
|
|
30
|
|
31 ;; This file is dumped with XEmacs.
|
|
32
|
|
33 ;; This file provides low level facilities for XEmacs startup --
|
|
34 ;; particularly regarding the package setup. This code has to run in
|
|
35 ;; what we call "bare temacs" -- i.e. XEmacs without the usual Lisp
|
|
36 ;; environment. Pay special attention:
|
|
37
|
|
38 ;; - not to use the `lambda' macro. Use #'(lambda ...) instead.
|
|
39 ;; (this goes for any package loaded before `subr.el'.)
|
|
40 ;;
|
|
41 ;; - not to use macros, because they are not yet available (and this
|
442
|
42 ;; file must be loadable uncompiled.) Built in macros, such as
|
|
43 ;; `when' and `unless' are fine, of course.
|
428
|
44 ;;
|
|
45 ;; - not to use `defcustom'. If you must add user-customizable
|
|
46 ;; variables here, use `defvar', and add the variable to
|
|
47 ;; `cus-start.el'.
|
|
48
|
|
49 ;; Because of all this, make sure that the stuff you put here really
|
|
50 ;; belongs here.
|
|
51
|
|
52 ;; This file requires find-paths.el.
|
|
53
|
|
54 ;;; Code:
|
|
55
|
|
56 ;;; Package versioning
|
|
57
|
|
58 (defvar packages-package-list nil
|
454
|
59 "Database of installed packages and version numbers")
|
428
|
60
|
|
61 (defvar packages-hierarchy-depth 1
|
|
62 "Depth of package hierarchies.")
|
|
63
|
|
64 (defvar packages-load-path-depth 1
|
|
65 "Depth of load-path search in package hierarchies.")
|
|
66
|
|
67 (defvar packages-data-path-depth 1
|
|
68 "Depth of data-path search in package hierarchies.")
|
|
69
|
|
70 (defvar early-packages nil
|
|
71 "Packages early in the load path.")
|
|
72
|
|
73 (defvar early-package-load-path nil
|
|
74 "Load path for packages early in the load path.")
|
|
75
|
|
76 (defvar late-packages nil
|
|
77 "Packages late in the load path.")
|
|
78
|
|
79 (defvar late-package-load-path nil
|
|
80 "Load path for packages late in the load path.")
|
|
81
|
|
82 (defvar last-packages nil
|
|
83 "Packages last in the load path.")
|
|
84
|
|
85 (defvar last-package-load-path nil
|
|
86 "Load path for packages last in the load path.")
|
|
87
|
|
88 (defun packages-compute-package-locations (user-init-directory)
|
|
89 "Compute locations of the various package directories.
|
|
90 This is a list each of whose elements describes one directory.
|
|
91 A directory description is a three-element list.
|
|
92 The first element is either an absolute path or a subdirectory
|
|
93 in the XEmacs hierarchy.
|
|
94 The second component is one of the symbols EARLY, LATE, LAST,
|
|
95 depending on the load-path segment the hierarchy is supposed to
|
|
96 show up in.
|
|
97 The third component is a thunk which, if it returns NIL, causes
|
|
98 the directory to be ignored."
|
|
99 (list
|
689
|
100 (list (paths-construct-path (list user-init-directory "site-packages"))
|
|
101 'early #'(lambda () t))
|
|
102 (list (paths-construct-path (list user-init-directory "infodock-packages"))
|
|
103 'early #'(lambda () (featurep 'infodock)))
|
428
|
104 (list (paths-construct-path (list user-init-directory "mule-packages"))
|
|
105 'early #'(lambda () (featurep 'mule)))
|
|
106 (list (paths-construct-path (list user-init-directory "xemacs-packages"))
|
|
107 'early #'(lambda () t))
|
|
108 (list "site-packages" 'late #'(lambda () t))
|
|
109 (list "infodock-packages" 'late #'(lambda () (featurep 'infodock)))
|
|
110 (list "mule-packages" 'late #'(lambda () (featurep 'mule)))
|
|
111 (list "xemacs-packages" 'late #'(lambda () t))))
|
|
112
|
|
113 (defun package-get-key-1 (info key)
|
|
114 "Locate keyword `key' in list."
|
|
115 (cond ((null info)
|
|
116 nil)
|
|
117 ((eq (car info) key)
|
|
118 (nth 1 info))
|
|
119 (t (package-get-key-1 (cddr info) key))))
|
|
120
|
|
121 (defun package-get-key (name key)
|
|
122 "Get info `key' from package `name'."
|
|
123 (let ((info (assq name packages-package-list)))
|
|
124 (when info
|
|
125 (package-get-key-1 (cdr info) key))))
|
|
126
|
|
127 (defun package-provide (name &rest attributes)
|
|
128 (let ((info (if (and attributes (floatp (car attributes)))
|
|
129 (list :version (car attributes))
|
|
130 attributes)))
|
|
131 (setq packages-package-list
|
|
132 (cons (cons name info) (remassq name packages-package-list)))))
|
|
133
|
|
134 (defun package-require (name version)
|
|
135 (let ((pkg (assq name packages-package-list)))
|
|
136 (cond ((null pkg)
|
|
137 (error "Package %s has not been loaded into this XEmacsen"
|
|
138 name))
|
|
139 ((< (package-get-key name :version) version)
|
|
140 (error "Need version %g of package %s, got version %g"
|
|
141 version name (cdr pkg)))
|
|
142 (t t))))
|
|
143
|
|
144 (defun package-delete-name (name)
|
|
145 (let (pkg)
|
|
146 ;; Delete ALL versions of package.
|
|
147 ;; This is pretty memory-intensive, as we use copy-alist when deleting
|
|
148 ;; package entries, to prevent side-effects in functions that call this
|
|
149 ;; one.
|
|
150 (while (setq pkg (assq name packages-package-list))
|
|
151 (setq packages-package-list (delete pkg (copy-alist
|
|
152 packages-package-list)))
|
|
153 )
|
|
154 ))
|
|
155
|
|
156 ;;; Build time stuff
|
|
157
|
|
158 (defvar autoload-file-name "auto-autoloads.el"
|
|
159 "Filename that autoloads are expected to be found in.")
|
|
160
|
|
161 (defvar packages-hardcoded-lisp
|
|
162 '(
|
|
163 ;; Nothing at this time
|
|
164 )
|
|
165 "Lisp packages that are always dumped with XEmacs.
|
|
166 This includes every package that is loaded directly by a package listed
|
|
167 in dumped-lisp.el and is not itself listed.")
|
|
168
|
|
169 (defvar packages-useful-lisp
|
|
170 '("bytecomp"
|
|
171 "byte-optimize"
|
528
|
172 "autoload"
|
428
|
173 "shadow"
|
|
174 "cl-macs")
|
|
175 "Lisp packages that need early byte compilation.")
|
|
176
|
|
177 (defvar packages-unbytecompiled-lisp
|
|
178 '("paths.el"
|
|
179 "dumped-lisp.el"
|
|
180 "dumped-pkg-lisp.el"
|
|
181 "version.el"
|
|
182 "very-early-lisp.el")
|
|
183 "Lisp packages that should not be byte compiled.")
|
|
184
|
|
185
|
|
186 ;; Copied from help.el, could possibly move it to here permanently.
|
|
187 ;; Unlike the FSF version, our `locate-library' uses the `locate-file'
|
|
188 ;; primitive, which should make it lightning-fast.
|
|
189
|
|
190 (defun locate-library (library &optional nosuffix path interactive-call)
|
|
191 "Show the precise file name of Emacs library LIBRARY.
|
|
192 This command searches the directories in `load-path' like `M-x load-library'
|
|
193 to find the file that `M-x load-library RET LIBRARY RET' would load.
|
|
194 Optional second arg NOSUFFIX non-nil means don't add suffixes `.elc' or `.el'
|
|
195 to the specified name LIBRARY.
|
|
196
|
|
197 If the optional third arg PATH is specified, that list of directories
|
|
198 is used instead of `load-path'."
|
624
|
199 (interactive (list (read-library-name "Locate library: ")
|
428
|
200 nil nil
|
|
201 t))
|
|
202 (let ((result
|
|
203 (locate-file
|
|
204 library
|
|
205 (or path load-path)
|
|
206 (cond ((or (rassq 'jka-compr-handler file-name-handler-alist)
|
|
207 (and (boundp 'find-file-hooks)
|
|
208 (member 'crypt-find-file-hook find-file-hooks)))
|
|
209 ;; Compression involved.
|
|
210 (if nosuffix
|
448
|
211 '("" ".gz" ".Z" ".bz2")
|
|
212 '(".elc" ".elc.gz" "elc.Z" ".elc.bz2"
|
|
213 ".el" ".el.gz" ".el.Z" ".el.bz2"
|
|
214 "" ".gz" ".Z" ".bz2")))
|
428
|
215 (t
|
|
216 ;; No compression.
|
|
217 (if nosuffix
|
|
218 ""
|
|
219 '(".elc" ".el" "")))))))
|
|
220 (and interactive-call
|
|
221 (if result
|
|
222 (message "Library is file %s" result)
|
|
223 (message "No library %s in search path" library)))
|
|
224 result))
|
|
225
|
|
226 (defun packages-add-suffix (str)
|
|
227 (if (null (string-match "\\.el\\'" str))
|
|
228 (concat str ".elc")
|
|
229 str))
|
|
230
|
|
231 (defun packages-list-autoloads-path ()
|
|
232 "List autoloads from precomputed load-path."
|
|
233 (let ((path load-path)
|
|
234 autoloads)
|
|
235 (while path
|
|
236 (if (file-exists-p (concat (car path)
|
|
237 autoload-file-name))
|
|
238 (setq autoloads (cons (concat (car path)
|
|
239 autoload-file-name)
|
|
240 autoloads)))
|
|
241 (setq path (cdr path)))
|
|
242 autoloads))
|
|
243
|
|
244 (defun packages-list-autoloads (source-directory)
|
|
245 "List autoload files in (what will be) the normal lisp search path.
|
|
246 This function is used during build to find where the global symbol files so
|
|
247 they can be perused for their useful information."
|
|
248 (let ((files (directory-files (file-name-as-directory source-directory)
|
|
249 t ".*"))
|
|
250 file autolist)
|
|
251 ;; (print (prin1-to-string source-directory))
|
|
252 ;; (print (prin1-to-string files))
|
|
253 (while (setq file (car-safe files))
|
|
254 (if (and (file-directory-p file)
|
|
255 (file-exists-p (concat (file-name-as-directory file)
|
|
256 autoload-file-name)))
|
|
257 (setq autolist (cons (concat (file-name-as-directory file)
|
|
258 autoload-file-name)
|
|
259 autolist)))
|
|
260 (setq files (cdr files)))
|
|
261 autolist))
|
|
262
|
|
263 ;; The following function cannot be called from a bare temacs
|
|
264 (defun packages-new-autoloads ()
|
|
265 "Return autoloads files that have been added or modified since XEmacs dump."
|
|
266 (require 'loadhist)
|
|
267 (let ((me (concat invocation-directory invocation-name))
|
|
268 (path load-path)
|
|
269 result dir)
|
|
270 (while path
|
|
271 (setq dir (file-truename (car path)))
|
|
272 (let ((autoload-file (file-name-sans-extension (concat
|
|
273 dir
|
|
274 autoload-file-name))))
|
|
275 ;; Check for:
|
|
276 ;; 1. An auto-autoload file that hasn't provided a feature (because
|
|
277 ;; it has been installed since XEmacs was dumped).
|
|
278 ;; 2. auto-autoload.el being newer than the executable
|
|
279 ;; 3. auto-autoload.elc being newer than the executable (the .el
|
|
280 ;; could be missing or compressed)
|
|
281 (when (or (and (null (file-provides autoload-file))
|
|
282 (or (file-exists-p (concat autoload-file ".elc"))
|
|
283 (file-exists-p (concat autoload-file ".el"))))
|
|
284 (and (file-newer-than-file-p (concat autoload-file ".el") me)
|
|
285 (setq autoload-file (concat autoload-file ".el")))
|
|
286 (and (file-newer-than-file-p (concat autoload-file
|
|
287 ".elc")
|
|
288 me)
|
|
289 (setq autoload-file (concat autoload-file ".elc"))))
|
|
290 (push autoload-file result)))
|
|
291 (setq path (cdr path)))
|
|
292 result))
|
|
293
|
|
294 ;; The following function cannot be called from a bare temacs
|
|
295 (defun packages-reload-autoloads ()
|
|
296 "Reload new or updated auto-autoloads files.
|
|
297 This is an extremely dangerous function to call after the user-init-files
|
|
298 is run. Don't call it or you'll be sorry."
|
|
299 (let ((autoload-list (packages-new-autoloads)))
|
|
300 (while autoload-list
|
|
301 (let* ((autoload-file (car autoload-list))
|
|
302 (feature (car-safe (file-provides autoload-file))))
|
|
303 (when feature
|
|
304 ;; (message "(unload-feature %S)" feature)
|
|
305 (unload-feature feature))
|
|
306 (condition-case nil
|
|
307 (load autoload-file)
|
|
308 (t nil)))
|
|
309 (setq autoload-list (cdr autoload-list)))))
|
|
310
|
|
311 ;; Data-directory is really a list now. Provide something to search it for
|
|
312 ;; directories.
|
|
313
|
|
314 (defun locate-data-directory-list (name &optional dir-list)
|
|
315 "Locate the matching list of directories in a search path DIR-LIST.
|
|
316 If no DIR-LIST is supplied, it defaults to `data-directory-list'."
|
|
317 (unless dir-list
|
|
318 (setq dir-list data-directory-list))
|
|
319 (let (found found-dir found-dir-list)
|
|
320 (while dir-list
|
|
321 (setq found (file-name-as-directory (concat (car dir-list) name))
|
|
322 found-dir (file-directory-p found))
|
|
323 (and found-dir
|
|
324 (setq found-dir-list (cons found found-dir-list)))
|
|
325 (setq dir-list (cdr dir-list)))
|
|
326 (nreverse found-dir-list)))
|
|
327
|
|
328 ;; Data-directory is really a list now. Provide something to search it for
|
|
329 ;; a directory.
|
|
330
|
|
331 (defun locate-data-directory (name &optional dir-list)
|
|
332 "Locate a directory in a search path DIR-LIST (a list of directories).
|
|
333 If no DIR-LIST is supplied, it defaults to `data-directory-list'."
|
|
334 (unless dir-list
|
|
335 (setq dir-list data-directory-list))
|
|
336 (let (found found-dir)
|
|
337 (while (and (null found-dir) dir-list)
|
|
338 (setq found (file-name-as-directory (concat (car dir-list) name))
|
|
339 found-dir (file-directory-p found))
|
|
340 (or found-dir
|
|
341 (setq found nil))
|
|
342 (setq dir-list (cdr dir-list)))
|
|
343 found))
|
|
344
|
|
345 ;; Data-directory is really a list now. Provide something to search it for
|
|
346 ;; files.
|
|
347
|
|
348 (defun locate-data-file (name &optional dir-list)
|
|
349 "Locate a file in a search path DIR-LIST (a list of directories).
|
|
350 If no DIR-LIST is supplied, it defaults to `data-directory-list'.
|
|
351 This function is basically a wrapper over `locate-file'."
|
633
|
352 (locate-file name (or dir-list data-directory-list)))
|
428
|
353
|
|
354 ;; Path setup
|
|
355
|
|
356 (defun packages-find-package-directories (roots base)
|
|
357 "Find a set of package directories."
|
|
358 ;; make sure paths-find-version-directory and paths-find-site-directory
|
|
359 ;; don't both pick up version-independent directories ...
|
|
360 (let ((version-directory (paths-find-version-directory roots base nil nil t))
|
442
|
361 (site-directory (paths-find-site-directory roots base nil nil t)))
|
428
|
362 (paths-uniq-append
|
|
363 (and version-directory (list version-directory))
|
|
364 (and site-directory (list site-directory)))))
|
|
365
|
444
|
366 (defvar packages-special-base-regexp "^\\(etc\\|info\\|man\\|lisp\\|lib-src\\|bin\\|pkginfo\\)$"
|
428
|
367 "Special subdirectories of packages.")
|
|
368
|
|
369 (defvar packages-no-package-hierarchy-regexp
|
|
370 (concat "\\(" paths-version-control-filename-regexp "\\)"
|
|
371 "\\|"
|
|
372 "\\(" packages-special-base-regexp "\\)")
|
|
373 "Directories which can't be the roots of package hierarchies.")
|
|
374
|
|
375 (defun packages-find-packages-in-directories (directories)
|
|
376 "Find all packages underneath directories in DIRECTORIES."
|
|
377 (paths-find-recursive-path directories
|
|
378 packages-hierarchy-depth
|
|
379 packages-no-package-hierarchy-regexp))
|
|
380
|
|
381 (defun packages-split-path (path)
|
|
382 "Split PATH at \"\", return pair with two components.
|
|
383 The second component is shared with PATH."
|
|
384 (let ((reverse-tail '())
|
|
385 (rest path))
|
|
386 (while (and rest (null (string-equal "" (car rest))))
|
|
387 (setq reverse-tail (cons (car rest) reverse-tail))
|
|
388 (setq rest (cdr rest)))
|
|
389 (if (null rest)
|
|
390 (cons path nil)
|
|
391 (cons (nreverse reverse-tail) (cdr rest)))))
|
|
392
|
|
393 (defun packages-split-package-path (package-path)
|
|
394 "Split up PACKAGE-PATH into early, late and last components.
|
|
395 The separation is by \"\" components.
|
|
396 This returns (LIST EARLY-PACKAGES LATE-PACKAGES LAST-PACKAGES)."
|
|
397 ;; When in doubt, it's late
|
|
398 (let* ((stuff (packages-split-path package-path))
|
|
399 (early (and (cdr stuff) (car stuff)))
|
|
400 (late+last (or (cdr stuff) (car stuff)))
|
|
401 (stuff (packages-split-path late+last))
|
|
402 (late (car stuff))
|
|
403 (last (cdr stuff)))
|
|
404 (list (packages-find-packages-in-directories early)
|
|
405 (packages-find-packages-in-directories late)
|
|
406 (packages-find-packages-in-directories last))))
|
|
407
|
|
408 (defun packages-deconstruct (list consumer)
|
|
409 "Deconstruct LIST and feed it to CONSUMER."
|
|
410 (apply consumer list))
|
|
411
|
|
412 (defun packages-find-packages-by-name (roots name)
|
|
413 "Find a package hierarchy by its name."
|
|
414 (packages-find-packages-in-directories
|
|
415 (if (and (file-name-absolute-p name)
|
|
416 (file-name-directory (expand-file-name name)))
|
|
417 (list (file-name-as-directory (expand-file-name name)))
|
|
418 (packages-find-package-directories roots name))))
|
|
419
|
|
420 (defun packages-find-packages-at-time
|
|
421 (roots package-locations time &optional default)
|
|
422 "Find packages at given time.
|
|
423 For the format of PACKAGE-LOCATIONS, see the global variable of the same name.
|
|
424 TIME is either 'EARLY, 'LATE, or 'LAST.
|
|
425 DEFAULT is a default list of packages."
|
|
426 (or default
|
|
427 (let ((packages '()))
|
|
428 (while package-locations
|
444
|
429 (packages-deconstruct
|
428
|
430 (car package-locations)
|
|
431 #'(lambda (name a-time thunk)
|
|
432 (if (and (eq time a-time)
|
|
433 (funcall thunk))
|
|
434 (setq packages
|
|
435 (nconc packages
|
|
436 (packages-find-packages-by-name roots name))))))
|
|
437 (setq package-locations (cdr package-locations)))
|
|
438 packages)))
|
|
439
|
|
440 (defun packages-find-packages (roots package-locations)
|
|
441 "Find the packages."
|
|
442 (let ((envvar-value (getenv "EMACSPACKAGEPATH")))
|
|
443 (if envvar-value
|
|
444 (packages-split-package-path (paths-decode-directory-path envvar-value))
|
|
445 (packages-deconstruct
|
|
446 (packages-split-package-path configure-package-path)
|
|
447 #'(lambda (configure-early-packages
|
|
448 configure-late-packages
|
|
449 configure-last-packages)
|
|
450 (list (packages-find-packages-at-time roots package-locations 'early
|
|
451 configure-early-packages)
|
|
452 (packages-find-packages-at-time roots package-locations 'late
|
|
453 configure-late-packages)
|
|
454 (packages-find-packages-at-time roots package-locations 'last
|
|
455 configure-last-packages)))))))
|
|
456
|
|
457 (defun packages-find-package-library-path (packages suffixes)
|
|
458 "Construct a path into a component of the packages hierarchy.
|
|
459 PACKAGES is a list of package directories.
|
|
460 SUFFIXES is a list of names of package subdirectories to look for."
|
|
461 (let ((directories
|
|
462 (apply
|
|
463 #'nconc
|
|
464 (mapcar #'(lambda (package)
|
|
465 (mapcar #'(lambda (suffix)
|
|
466 (file-name-as-directory (concat package suffix)))
|
|
467 suffixes))
|
|
468 packages))))
|
|
469 (paths-directories-which-exist directories)))
|
|
470
|
|
471 (defun packages-find-package-load-path (packages)
|
|
472 "Construct the load-path component for packages.
|
|
473 PACKAGES is a list of package directories."
|
|
474 (paths-find-recursive-load-path
|
|
475 (packages-find-package-library-path packages
|
|
476 '("lisp"))
|
|
477 packages-load-path-depth))
|
|
478
|
|
479 (defun packages-find-package-exec-path (packages)
|
|
480 "Construct the exec-path component for packages.
|
|
481 PACKAGES is a list of package directories."
|
|
482 (packages-find-package-library-path packages
|
|
483 (list (paths-construct-path
|
|
484 (list "bin" system-configuration))
|
|
485 "lib-src")))
|
|
486
|
|
487 (defun packages-find-package-info-path (packages)
|
|
488 "Construct the info-path component for packages.
|
|
489 PACKAGES is a list of package directories."
|
|
490 (packages-find-package-library-path packages '("info")))
|
|
491
|
|
492 (defun packages-find-package-data-path (packages)
|
|
493 "Construct the data-path component for packages.
|
|
494 PACKAGES is a list of package directories."
|
|
495 (paths-find-recursive-load-path
|
|
496 (packages-find-package-library-path packages
|
|
497 '("etc"))
|
|
498 packages-data-path-depth))
|
|
499
|
|
500 ;; Loading package initialization files
|
|
501
|
|
502 (defun packages-load-package-lisps (package-load-path base)
|
|
503 "Load all Lisp files of a certain name along a load path.
|
|
504 BASE is the base name of the files."
|
|
505 (mapcar #'(lambda (dir)
|
793
|
506 (let ((file-name (expand-file-name base dir)))
|
|
507 (with-trapping-errors
|
|
508 :operation (format "Autoload %s" file-name)
|
|
509 :class 'packages
|
|
510 (load file-name t t))))
|
|
511 package-load-path))
|
428
|
512
|
|
513 (defun packages-load-package-auto-autoloads (package-load-path)
|
|
514 "Load auto-autoload files along a load path."
|
|
515 (packages-load-package-lisps package-load-path
|
|
516 (file-name-sans-extension autoload-file-name)))
|
|
517
|
|
518 (defun packages-handle-package-dumped-lisps (handle package-load-path)
|
|
519 "Load dumped-lisp.el files along a load path.
|
|
520 Call HANDLE on each file off definitions of PACKAGE-LISP there."
|
|
521 (mapcar #'(lambda (dir)
|
|
522 (let ((file-name (expand-file-name "dumped-lisp.el" dir)))
|
|
523 (if (file-exists-p file-name)
|
|
524 (let (package-lisp
|
|
525 ;; 20.4 packages could set this
|
|
526 preloaded-file-list)
|
|
527 (load file-name)
|
|
528 ;; dumped-lisp.el could have set this ...
|
|
529 (if package-lisp
|
|
530 (mapcar #'(lambda (base)
|
|
531 (funcall handle base))
|
|
532 package-lisp))))))
|
|
533 package-load-path))
|
|
534
|
|
535 (defun packages-load-package-dumped-lisps (package-load-path)
|
|
536 "Load dumped-lisp.el files along a load path.
|
444
|
537 Also load files off PACKAGE-LISP definitions there."
|
428
|
538 (packages-handle-package-dumped-lisps #'load package-load-path))
|
|
539
|
|
540 (defun packages-collect-package-dumped-lisps (package-load-path)
|
|
541 "Load dumped-lisp.el files along a load path.
|
444
|
542 Return list of files off PACKAGE-LISP definitions there."
|
428
|
543 (let ((*files* '()))
|
|
544 (packages-handle-package-dumped-lisps
|
|
545 #'(lambda (file)
|
|
546 (setq *files* (cons file *files*)))
|
|
547 package-load-path)
|
|
548 (reverse *files*)))
|
|
549
|
|
550 (provide 'packages)
|
|
551
|
|
552 ;;; packages.el ends here
|