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