(config-apel-package): Check for (early|late|last)-package-hierarchies and
[elisp/apel.git] / APEL-MK
diff --git a/APEL-MK b/APEL-MK
index 394586e..017362b 100644 (file)
--- a/APEL-MK
+++ b/APEL-MK
   ;; Set PACKAGEDIR if not set yet.
   (or PACKAGEDIR
       (setq PACKAGEDIR
-           (if (boundp 'early-packages)
-               (let ((dirs (append (if early-package-load-path
-                                       early-packages)
-                                   (if late-package-load-path
-                                       late-packages)
-                                   (if last-package-load-path
-                                       last-packages)))
-                     dir)
-                 (while (not (file-exists-p (setq dir (car dirs))))
-                   (setq dirs (cdr dirs)))
-                 dir))))
+           (let ((dirs (append
+                        (cond ((boundp 'early-package-hierarchies)
+                               (append (if early-package-load-path
+                                           early-package-hierarchies)
+                                       (if late-package-load-path
+                                           late-package-hierarchies)
+                                       (if last-package-load-path
+                                           last-package-hierarchies)))
+                              ((boundp 'early-packages)
+                               (append (if early-package-load-path
+                                           early-packages)
+                                       (if late-package-load-path
+                                           late-packages)
+                                       (if last-package-load-path
+                                           last-packages))))
+                        (if (and (boundp 'configure-package-path)
+                                 (listp configure-package-path))
+                            (delete "" configure-package-path))))
+                 dir)
+             (while (not (file-exists-p (setq dir (car dirs))))
+               (setq dirs (cdr dirs)))
+             dir)))
   (if PACKAGEDIR
       (princ (format "\nPACKAGEDIR=%s\n" PACKAGEDIR))
     (error "XEmacs package system is not available")))