> Done. Should we close the issue then, or wait for more feedback?
fa8135f8916 * emacs-29 origin/emacs-29 Revert changes to the order in which package descs are loaded
- (dolist (pkg-dir (directory-files dir t "\\`[^.]" t))
+ (dolist (pkg-dir (directory-files dir t "\\`[^.]"))
it doesn't fix the initial problem: `load-path` and `package-alist` are still broken in my test.
Test:
To reproduce the case we need emacs 29.0.91 + fa8135f8916 fix and
~/.emacs.d/elpa/go-mode-20170726.555/...
~/.emacs.d/elpa/go-mode-20220114.2239/...
Run `emacs -Q` and `M-x package-initialize`. After that `package-alist` and `load-path` contain the 2017 version as the first item in the list (instead of 2022).
It can be fixed like this:
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index ba0e3618f28..6eaf261f5f4 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -922,11 +922,13 @@ correspond to previously loaded files."
(v2 (package-desc-version p2)))
(or
;; Prefer VC packages.
- (package-vc-p p1)
- (package-vc-p p2)
+ (and
+ (package-vc-p p1)
+ (not (package-vc-p p2)))
;; Prefer builtin packages.
- (package-disabled-p p1 v1)
- (not (package-disabled-p p2 v2))))))))
+ (and
+ (package-built-in-p p1 v1)
+ (not (package-built-in-p p2 v2)))))))))
;; Check if PACKAGE is available in `package-alist'.
(while
(when pkg-descs
But if we leave it until 29.2, I will not insist :)