GNU bug report logs -
#72141
29.4; package-upgrade vs package-load-list
Previous Next
Full log
Message #35 received at 72141 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Thierry Volpiatto <thievol <at> posteo.net> writes:
> Hello Philip,
>
> Philip Kaludercic <philipk <at> 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
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 310 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.