From: "Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Philip Kaludercic <philipk@posteo.net>,
63757@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#63757: 29.0.91 order of package paths changed: random old versions of packages in load-path
Date: Sat, 3 Jun 2023 22:53:58 +1000 [thread overview]
Message-ID: <CAKOwOe5Vg8MV4NqhXuAr2en=nnBzrvvMoQvV=G0nWJbY+V6P6w@mail.gmail.com> (raw)
In-Reply-To: <CAKOwOe5J1-BVHkHS0qp_j-bsV3FVopU8+rvAoDqzGWEW1O+Rbg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5117 bytes --]
The idea is to split the list to 3 parts and to sort each of them by
version-list-< separately (but I am not sure which combination of
preference is correct) and to flatten at the end
((VC packages) (builtin packages) (the rest))
I use (package-vc-p p1) and (assq p1 package--builtins) predicates for
splitting (not sure for builtin). The code below needs refactoring.
(require 'cl)
(defun package--get-activatable-pkg (pkg-name)
;; Is "activatable" a word?
(let ((pkg-descs
(flatten-list
(mapcar (lambda (x)
(sort x
(lambda (p1 p2)
(let ((v1 (package-desc-version p1))
(v2 (package-desc-version p2)))
(version-list-< v2 v1)))))
(let ((y (reduce
(lambda (p1 p2)
(if (package-vc-p p1)
(push p1 (first p2))
(push p1 (second p2)))
p2)
(cdr (assq pkg-name package-alist))
:initial-value (list nil nil)
:from-end t)))
(append (list (car y))
(reduce
(lambda (p1 p2)
(if (assq p1 package--builtins)
(push p1 (first p2))
(push p1 (second p2))
p2))
(cadr y)
:initial-value (list nil nil)
:from-end t)))))))
;; Check if PACKAGE is available in `package-alist'.
(while
(when pkg-descs
(let ((available-version (package-desc-version (car pkg-descs))))
(package-disabled-p pkg-name available-version)))
(setq pkg-descs (cdr pkg-descs)))
(car pkg-descs)))
On Sat, Jun 3, 2023 at 9:50 PM Евгений Бойков <artscan@list.ru> wrote:
> The fix above will not work.
>
> I can do it for "Prefer VC packages" only:
>
> (require 'cl)
> (defun package--get-activatable-pkg (pkg-name)
> ;; Is "activatable" a word?
> (let ((pkg-descs
> (flatten-list
> (mapcar (lambda (x)
> (sort x
> (lambda (p1 p2)
> (let ((v1 (package-desc-version p1))
> (v2 (package-desc-version p2)))
> (version-list-< v2 v1)))))
> (reduce
> (lambda (p1 p2)
> (if (package-vc-p p1)
> (push p1 (first p2))
> (push p1 (second p2)))
> p2)
> (cdr (assq pkg-name package-alist))
> :initial-value (list nil nil)
> :from-end t)))))
> ;; Check if PACKAGE is available in `package-alist'.
> (while
> (when pkg-descs
> (let ((available-version (package-desc-version (car pkg-descs))))
> (package-disabled-p pkg-name available-version)))
> (setq pkg-descs (cdr pkg-descs)))
> (car pkg-descs)))
>
>
> Still can't for "Prefer builtin packages".
>
>
> On Sat, Jun 3, 2023 at 8:37 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
>> > From: Philip Kaludercic <philipk@posteo.net>
>> > Cc: Евгений Бойков <artscan@list.ru>,
>> > 63757@debbugs.gnu.org, Stefan
>> > Monnier <monnier@iro.umontreal.ca>
>> > Date: Sat, 03 Jun 2023 10:19:24 +0000
>> >
>> > > Won't this work:
>> > >
>> > > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
>> > > index 01826da273d..7eb185e7042 100644
>> > > --- a/lisp/emacs-lisp/package.el
>> > > +++ b/lisp/emacs-lisp/package.el
>> > > @@ -927,7 +927,9 @@ package--get-activatable-pkg
>> > > (package-vc-p p2)
>> > > ;; Prefer builtin packages.
>> > > (package-disabled-p p1 v1)
>> > > - (not (package-disabled-p p2 v2))))))))
>> > > + (not (package-disabled-p p2 v2))
>> > > + ;; Prever newer packages
>> > > + (version-list-< v2 v1)))))))
>> > > ;; Check if PACKAGE is available in `package-alist'.
>> > > (while
>> > > (when pkg-descs
>> >
>> > Ping?
>>
>> If there's no response, and you think this is the right fix, we can
>> simply install it, I guess.
>>
>
>
> --
> __________________________
>
> С уважением,
> Бойков Евгений Алексеевич
> сот. 8-924-202-25-65
> e-mail: artscan@list.ru
>
--
__________________________
С уважением,
Бойков Евгений Алексеевич
сот. 8-924-202-25-65
e-mail: artscan@list.ru
[-- Attachment #2: Type: text/html, Size: 7401 bytes --]
next prev parent reply other threads:[~2023-06-03 12:53 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-27 16:30 bug#63757: 29.0.91 order of package paths changed: random old versions of packages in load-path Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-29 11:09 ` Eli Zaretskii
2023-05-29 14:24 ` Philip Kaludercic
2023-06-03 10:19 ` Philip Kaludercic
2023-06-03 10:38 ` Eli Zaretskii
2023-06-03 11:50 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03 12:53 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-06-03 13:33 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03 14:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 4:46 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 5:37 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 5:41 ` Eli Zaretskii
2023-06-04 7:47 ` Philip Kaludercic
2023-06-04 8:03 ` Eli Zaretskii
2023-06-04 9:19 ` Philip Kaludercic
2023-06-04 10:14 ` Eli Zaretskii
2023-06-04 11:39 ` Philip Kaludercic
2023-06-04 12:08 ` Eli Zaretskii
2023-06-04 12:12 ` Philip Kaludercic
2023-06-04 12:19 ` Eli Zaretskii
2023-06-04 12:32 ` Philip Kaludercic
2023-06-04 12:46 ` Eli Zaretskii
2023-06-04 13:21 ` Philip Kaludercic
2023-06-04 14:03 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 14:24 ` Philip Kaludercic
2023-06-04 14:30 ` Eli Zaretskii
2023-06-04 14:47 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 14:55 ` Eli Zaretskii
2023-06-04 16:36 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 15:12 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 15:20 ` Eli Zaretskii
2023-06-04 15:47 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 16:15 ` Philip Kaludercic
2023-06-04 16:30 ` Eli Zaretskii
2023-06-04 16:53 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 17:37 ` Philip Kaludercic
2023-06-04 18:32 ` Eli Zaretskii
2023-06-04 16:44 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 18:40 ` Philip Kaludercic
2023-06-04 19:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-05 7:55 ` Philip Kaludercic
2023-06-05 14:55 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-07 15:36 ` Eli Zaretskii
2023-06-07 18:38 ` Philip Kaludercic
2023-06-07 19:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-08 9:26 ` Eli Zaretskii
2023-06-04 16:28 ` Eli Zaretskii
2023-06-04 15:45 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 14:46 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 14:54 ` Eli Zaretskii
2023-06-04 15:03 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 12:14 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 7:52 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 8:06 ` Eli Zaretskii
2023-06-04 8:43 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 8:54 ` Eli Zaretskii
2023-06-04 9:10 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 9:17 ` Philip Kaludercic
2023-06-04 10:16 ` Eli Zaretskii
2023-06-04 9:52 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04 14:54 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-29 13:25 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-29 15:44 ` Евгений Бойков via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-30 2:44 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03 8:37 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKOwOe5Vg8MV4NqhXuAr2en=nnBzrvvMoQvV=G0nWJbY+V6P6w@mail.gmail.com' \
--to=bug-gnu-emacs@gnu.org \
--cc=63757@debbugs.gnu.org \
--cc=artscan@list.ru \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=philipk@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.