From: Thierry Volpiatto <thievol@posteo.net>
To: Thierry Volpiatto <thievol@posteo.net>
Cc: Philip Kaludercic <philipk@posteo.net>,
Eli Zaretskii <eliz@gnu.org>,
72141@debbugs.gnu.org
Subject: bug#72141: 29.4; package-upgrade vs package-load-list
Date: Sat, 10 Aug 2024 17:16:54 +0000 [thread overview]
Message-ID: <87zfpkqovt.fsf@posteo.net> (raw)
In-Reply-To: <87ikwgjjl3.fsf@posteo.net> (Thierry Volpiatto's message of "Sun, 04 Aug 2024 17:15:04 +0000")
[-- Attachment #1: Type: text/plain, Size: 1845 bytes --]
Thierry Volpiatto <thievol@posteo.net> writes:
> Hello Philip,
>
> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Gladly, then I'd like to try it out it and perhaps write a ERT test.
>
> Patch attached, please review and test it before merging ;-)
>
> Thanks.
Also, I recently had to read package.el code and I found many loops are
too complex and/or too difficult to read, here are some:
--8<---------------cut here---------------start------------->8---
(equal
;; old
(mapcar #'symbol-name (mapcar #'car package-alist))
;; new
(mapcar (lambda (pkg) (symbol-name (car pkg))) package-alist))
(equal
;; old
(mapcar
(lambda (p) (cons (package-desc-full-name p) p))
(delq nil
(mapcar (lambda (p) (unless (package-built-in-p p) p))
(apply #'append (mapcar #'cdr (package--alist))))))
;; new
(cl-loop for (p desc) in package-alist
unless (package-built-in-p p)
collect (cons (package-desc-full-name desc) desc)))
;; Change w3m to an installed package in your Emacs.
(let ((alist (package-desc-extras (cadr (assq 'w3m package-alist)))))
(equal
;; old
(mapcar #'macroexp-quote
(apply #'nconc
(mapcar (lambda (pair) (list (car pair) (cdr pair))) alist)))
;; new
(cl-loop for lst in alist
nconc `(,(car lst) ,(macroexp-quote (cdr lst))))))
(equal
;; old
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car load-history)))
;; new
(cl-loop for (name _rest) in load-history
when (stringp name)
collect (file-truename name)))
--8<---------------cut here---------------end--------------->8---
I have a patch for this, let me know if interested, or perhaps I should
open a new bug report ?
--
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]
next prev parent reply other threads:[~2024-08-10 17:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 14:46 bug#72141: 29.4; package-upgrade vs package-load-list Thierry Volpiatto
2024-07-27 7:14 ` Eli Zaretskii
2024-07-28 11:47 ` Philip Kaludercic
2024-07-28 12:27 ` Thierry Volpiatto
2024-07-28 12:27 ` Eli Zaretskii
2024-07-28 12:39 ` Thierry Volpiatto
2024-08-01 6:48 ` Thierry Volpiatto
2024-08-03 3:22 ` Thierry Volpiatto
2024-08-04 14:57 ` Philip Kaludercic
2024-08-04 17:15 ` Thierry Volpiatto
2024-08-10 17:16 ` Thierry Volpiatto [this message]
2024-08-12 16:36 ` Philip Kaludercic
2024-08-12 17:36 ` Thierry Volpiatto
2024-08-12 18:16 ` Thierry Volpiatto
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zfpkqovt.fsf@posteo.net \
--to=thievol@posteo.net \
--cc=72141@debbugs.gnu.org \
--cc=eliz@gnu.org \
--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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).