[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: package-update-all from command line
From: |
Stefan Monnier |
Subject: |
Re: package-update-all from command line |
Date: |
Tue, 24 May 2022 11:52:32 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
> replacing `package-initialize' with `package-activate-all' above results in
>
> --8<---------------cut here---------------start------------->8---
> Debugger entered--Lisp error: (void-function package-update-all)
> --8<---------------cut here---------------end--------------->8---
Hmm... maybe it should be autoloaded, then?
>>> -eval '(setq package-selected-packages (delete-dups
>>> package-activated-list))' \
>> Hmm... I wonder why you needed that.
> because otherwise `package-selected-packages' is nil and there is
> nothing to update.
I can't see in the code where `package-update-all` ends up using
`package-selected-packages`.
At the place where it uses it, it probably should auto-initialize it if
it's still nil.
> and I need `delete-dups' because `package-activated-list' will repeat
> all installed packages as many times as `list-packages' or
> `package-quickstart-refresh' was called.
I can't see in the code many efforts to make absolutely sure that
duplicates don't make it there, admittedly.
But `package-quickstart-refresh` let-binds it to nil around the whole
call so it shouldn't be able to modify it at all. And I can't think of
any reason why `list-packages` would modify that var either.
IOW, sounds like a bug somewhere.
>>> E.g., I would like to save `package-archives' in
>>> `package-quickstart-file' so that I won't have to specify it on the
>>> command line (it is set in ~/.emacs, of course).
>> I can't think of a way to do that in a way that's reliable for all the
>> various ways this var can be set. :-(
[ Too many "way"s here, sorry. ]
> just add a setq at the end, like we already do with `package-activated-list'.
`package-activated-list` is easy because it's not meant to be set by
the user.
`package-archives` is a completely different problem because it's
a defcustom which may be set to a different value in the user's config
in all kinds of different ways, and which may be eval'd either before or
after loading the quickstart file, so it *would* mess up the user's
config in various circumstances.
We could do it upon the user's request, of course, but doing it
automatically by default is not really an option :-(
Maybe a more general way to attack this problem would be to try and
create a "quickinit.el" file which is a bit like a "dump" of the user's
config, so it can be used instead of loading `init.el`?
Stefan
- package-update-all from command line, Sam Steingold, 2022/05/23
- Re: package-update-all from command line, Stefan Monnier, 2022/05/24
- Re: package-update-all from command line, Sam Steingold, 2022/05/24
- Re: package-update-all from command line,
Stefan Monnier <=
- Re: package-update-all from command line, Sam Steingold, 2022/05/24
- Re: package-update-all from command line, Stefan Monnier, 2022/05/24
- Re: package-update-all from command line, Sam Steingold, 2022/05/25
- Re: package-update-all from command line, Stefan Monnier, 2022/05/25
- Re: package-update-all from command line, Sam Steingold, 2022/05/26
- Re: package-update-all from command line, Stefan Monnier, 2022/05/26
Re: package-update-all from command line, Lars Ingebrigtsen, 2022/05/24