[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proposal for 'package-isolate' command
From: |
Thierry Volpiatto |
Subject: |
Re: Proposal for 'package-isolate' command |
Date: |
Sun, 20 Aug 2023 06:40:16 +0000 |
Hello Philip,
Philip Kaludercic <philipk@posteo.net> writes:
> How about this patch, that will use a temporary directory when
> `package-isolate' is invoked with a prefix argument (not sure what the
> default should be, I guess reusing `user-emacs-directory' is less
> surprising):
>
> [2. text/x-diff;
> 0001-Add-command-to-start-Emacs-with-specific-packages.patch]...
I was reading the code of the new version of `package--dependencies` and
had some questions:
--8<---------------cut here---------------start------------->8---
(named-let more ((pkg-desc desc))
(let (deps)
(dolist (req (package-desc-reqs pkg-desc))
(setq deps (nconc
(catch 'found
(dolist (p (apply #'append (mapcar #'cdr
(package--alist))))
(when (and (string= (car req) (package-desc-name p))
(version-list-<= (cadr req)
(package-desc-version p)))
(throw 'found (more p)))))
deps)))
(delete-dups (cons pkg-desc deps))))
--8<---------------cut here---------------end--------------->8---
Why are you using `string=` to compare (car req)
with (package-desc-name p)?
Isn't (apply #'append (mapcar #'cdr (package--alist))) same as
(mapcar #'cadr (package--alist))?
I am not a fan of named-let but isn't using deps as a second arg of
'more' more in the named-let spirit? (fully not tested)
--8<---------------cut here---------------start------------->8---
(named-let more ((pkg-desc desc)
(deps nil))
(dolist (req (package-desc-reqs pkg-desc))
(setq deps (nconc
(catch 'found
(dolist (p (apply #'append (mapcar #'cdr
(package--alist))))
(when (and (string= (car req) (package-desc-name p))
(version-list-<= (cadr req)
(package-desc-version p)))
(throw 'found (more p deps)))))
deps)))
(delete-dups (cons pkg-desc deps)))
--8<---------------cut here---------------end--------------->8---
Thanks.
--
Thierry
signature.asc
Description: PGP signature
- Re: Proposal for 'package-isolate' command, (continued)
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/17
- Re: Proposal for 'package-isolate' command, Philip Kaludercic, 2023/08/17
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/17
- Re: Proposal for 'package-isolate' command, Philip Kaludercic, 2023/08/17
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/18
- Re: Proposal for 'package-isolate' command, Eli Zaretskii, 2023/08/18
- Re: Proposal for 'package-isolate' command, Philip Kaludercic, 2023/08/18
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/18
- Re: Adding package and package-vc to ELPA, Philip Kaludercic, 2023/08/18
- Re: Adding package and package-vc to ELPA, Thierry Volpiatto, 2023/08/19
- Re: Proposal for 'package-isolate' command,
Thierry Volpiatto <=
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/20
- Re: Proposal for 'package-isolate' command, Philip Kaludercic, 2023/08/20
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/20
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/20
- Re: Proposal for 'package-isolate' command, Philip Kaludercic, 2023/08/20
- Re: Changes to make in elpa-packages file for nongnu elpa, Eli Zaretskii, 2023/08/16
- Re: Changes to make in elpa-packages file for nongnu elpa, Philip Kaludercic, 2023/08/16
- Re: Changes to make in elpa-packages file for nongnu elpa, Thierry Volpiatto, 2023/08/08
- Re: Changes to make in elpa-packages file for nongnu elpa, Michael Albinus, 2023/08/08
- Re: Changes to make in elpa-packages file for nongnu elpa, Philip Kaludercic, 2023/08/08