From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: package-update-all from command line Date: Tue, 24 May 2022 11:52:32 -0400 Message-ID: References: <877d6bd2a2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22425"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Lars Magne Ingebrigtsen To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 24 18:42:26 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntXc0-0005Zf-9d for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 18:42:24 +0200 Original-Received: from localhost ([::1]:38948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntXby-0006Kg-VQ for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 12:42:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntWq8-0003La-T5 for emacs-devel@gnu.org; Tue, 24 May 2022 11:52:58 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntWpu-0007Mh-FG for emacs-devel@gnu.org; Tue, 24 May 2022 11:52:55 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 90D2D80767; Tue, 24 May 2022 11:52:39 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B105D80292; Tue, 24 May 2022 11:52:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1653407557; bh=tydB9dRgj2KYabAvFQGBmu3wSt0pdxi6YWOLmoER10I=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=kMSWgvSTOgM+EvRfDy688aTR4MLRjYTvVAN2gJgUsi/0kiUZGtVlw+aa/5y3teght ox02j5EXcKivIjsa8YVzmtRsVTO3Cno+eh5sKqHisI2R2QhzocXBCboJ6Gepepyo+d pJBMbzOlb8HSoVozrIn7Fd0P74SzQWgiNxq6iWQAuMuhupoke7ooOW6QZEIM4oe5zd xyFRmII7sgeEOcYcO+pYrRyzZSQ30oY9Z9yTzYTF4rN8FnK0NEIVDFAKgj98Da2WLM 4VIuQGzLkIsb2/Sz/pE1V4PylFjZYiQ0S0Cign3SvclONJG6C9/qI1fxZ3o7ahwgSy dxn2if7+iOacQ== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7F8F4120848; Tue, 24 May 2022 11:52:36 -0400 (EDT) In-Reply-To: (Sam Steingold's message of "Tue, 24 May 2022 11:04:15 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290197 Archived-At: > 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