bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#63757: 29.0.91 order of package paths changed: random old versions o


From: Stefan Monnier
Subject: bug#63757: 29.0.91 order of package paths changed: random old versions of packages in load-path
Date: Sun, 04 Jun 2023 11:12:31 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

> 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

Sounds about right.  Except:

- We still need a `copy-sequence` to avoid `sort` side-effecting the
  `package-alist` contents.
- I'm not sure the change of `package-disabled-p` =>
  `package-built-in-p` is right: it makes the code obey the comment, but
  I don't think we want to prefer built-in packages.

With these two tweaks, I suspect it might actually really fix the bug in
a way that should be safe enough for `emacs-29`.


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]