(chinese-cns11643-3): Don't define if `utf-2000' is provided because
[chise/xemacs-chise.git] / lisp / packages.el
index 49f4fd4..03d001b 100644 (file)
@@ -55,7 +55,7 @@
 ;;; Package versioning
 
 (defvar packages-package-list nil
-  "database of loaded packages and version numbers")
+  "Database of loaded packages and version numbers")
 
 (defvar packages-hierarchy-depth 1
   "Depth of package hierarchies.")
 
 (defvar package-locations
   (list
-   (list (paths-construct-path '("~" ".xemacs"))
+   (list (paths-construct-path '("~" ".xemacs" "mule-packages"))
+                             'early #'(lambda () (featurep 'mule)))
+   (list (paths-construct-path '("~" ".xemacs" "xemacs-packages"))
                              'early #'(lambda () t))
    (list "site-packages"     'late  #'(lambda () t))
    (list "infodock-packages" 'late  #'(lambda () (featurep 'infodock)))
    (list "mule-packages"     'late  #'(lambda () (featurep 'mule)))
-   (list "xemacs-packages"   'late  #'(lambda () t))
-   (list "packages"          'late  #'(lambda () t)))
+   (list "xemacs-packages"   'late  #'(lambda () t)))
   "Locations of the various package directories.
 This is a list each of whose elements describes one directory.
 A directory description is a three-element list.
@@ -122,9 +123,8 @@ the directory to be ignored.")
   (let ((info (if (and attributes (floatp (car attributes)))
                  (list :version (car attributes))
                attributes)))
-    (remassq name packages-package-list)
     (setq packages-package-list
-         (cons (cons name info) packages-package-list))))
+         (cons (cons name info) (remassq name packages-package-list)))))
 
 (defun package-require (name version)
   (let ((pkg (assq name packages-package-list)))
@@ -173,8 +173,7 @@ in dumped-lisp.el and is not itself listed.")
     "dumped-lisp.el"
     "dumped-pkg-lisp.el"
     "version.el"
-    "very-early-lisp.el"
-    "Installation.el")
+    "very-early-lisp.el")
   "Lisp packages that should not be byte compiled.")
 
 
@@ -203,14 +202,13 @@ is used instead of `load-path'."
                          (member 'crypt-find-file-hook find-file-hooks)))
                 ;; Compression involved.
                 (if nosuffix
-                    ":.gz:.Z"
-                  ".elc:.elc.gz:elc.Z:.el:.el.gz:.el.Z::.gz:.Z"))
+                    '("" ".gz" ".Z")
+                  '(".elc" ".elc.gz" "elc.Z" ".el" ".el.gz" ".el.Z" "" ".gz" ".Z")))
                (t
                 ;; No compression.
                 (if nosuffix
                     ""
-                  ".elc:.el:")))
-         4)))
+                  '(".elc" ".el" "")))))))
     (and interactive-call
         (if result
             (message "Library is file %s" result)
@@ -343,9 +341,7 @@ If no DIR-LIST is supplied, it defaults to `data-directory-list'."
   "Locate a file in a search path DIR-LIST (a list of directories).
 If no DIR-LIST is supplied, it defaults to `data-directory-list'.
 This function is basically a wrapper over `locate-file'."
-  (unless dir-list
-    (setq dir-list data-directory-list))
-  (locate-file name dir-list))
+  (locate-file name (or dir-list data-directory-list)))
 
 ;; Path setup
 
@@ -456,7 +452,7 @@ PACKAGES is a list of package directories.
 SUFFIXES is a list of names of package subdirectories to look for."
   (let ((directories
         (apply
-         #'append
+         #'nconc
          (mapcar #'(lambda (package)
                      (mapcar #'(lambda (suffix)
                                  (file-name-as-directory (concat package suffix)))