emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: package-update-all from command line


From: Sam Steingold
Subject: Re: package-update-all from command line
Date: Tue, 24 May 2022 15:01:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)

> * Stefan Monnier <zbaavre@veb.hzbagerny.pn> [2022-05-24 11:52:32 -0400]:
>
>> 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?

probably...

>>>>   -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.

note that it should be auto-initialized based on package-quickstart.el
which contains the list of packages that the used installed.

>> 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.

The breakage may come from loading package-quickstart.el multiple times.
One is not supposed to do that, of course...

>>>> 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.

so save a new non-user variable like `package-current-archives' instead,
so that I can set `package-archives' from it on the command line.

> 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`?

here we already have package-quickstart.el which can be re-used.

-- 
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.2113
http://childpsy.net http://calmchildstories.com http://steingoldpsychology.com
https://honestreporting.com https://camera.org https://thereligionofpeace.com
MS: Brain off-line, please wait.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]