From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.devel Subject: Re: package-update-all from command line Date: Tue, 24 May 2022 15:01:24 -0400 Message-ID: References: <877d6bd2a2.fsf@gnu.org> Reply-To: sds@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="11600"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) To: emacs-devel@gnu.org, Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 24 21:03:58 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 1ntZow-0002iW-BT for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 21:03:54 +0200 Original-Received: from localhost ([::1]:49152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntZov-0001IM-2F for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 15:03:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntZmc-0007RN-MA for emacs-devel@gnu.org; Tue, 24 May 2022 15:01:32 -0400 Original-Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:37484) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntZmZ-0005LP-5z; Tue, 24 May 2022 15:01:30 -0400 Original-Received: by mail-qt1-x82d.google.com with SMTP id y15so11146791qtx.4; Tue, 24 May 2022 12:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:in-reply-to:references:user-agent :return-receipt-to:reply-to:mail-followup-to:date:message-id :mime-version; bh=+BhUkoPNKNOrhV13/aRTxSpO7tM0CEUyHo1hGrTr4Ds=; b=cAlsyQ4wVBxTayGsscPbc1HBTXYqTxWhnXl25vbvY4vN4I1Ie37k4hHNqmv8lFRAT6 DN16P9AkNQHdMzsn97jTSkM+LAeUY3f7ZnL0LQLGFyypDAhhrl4cKwMSTAXsiE77n8Q1 SQcDLtFAePa9G/D/N7vFdVoF4XPYyqyffZ3WrDRyaaCHWzkb9FDhLBjF7/236hcOzerO zM3PW3eT+C7ccJUhDkKKRGiymNH0qcS62iC8+C362D3DUsrip2K9h/IbR2McbjBqpHpS Y3SOirW7VEHlQV1T33B68jdzMQMKs6FrbPAzv4YJRcgKr+xd4Qaxc7SJD74yPnSVynYc zSKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:in-reply-to:references :user-agent:return-receipt-to:reply-to:mail-followup-to:date :message-id:mime-version; bh=+BhUkoPNKNOrhV13/aRTxSpO7tM0CEUyHo1hGrTr4Ds=; b=tDVxv0atKJyLz+uDN2o9sqJ/AJywuddhlRxRbVuGPSTM7+bMjjhEJ2D+Y7ZrLDr8hZ ZDAF2GCYyUCGKUooYeZB40Pe09T/xubaeEE59FF9hehDVGah9dXR8XK2QjM1Ix71pqLF XKCyUnjfq8kqGCYp6cK5yIkUky1Da0W4RTwgSYAFgRBoSb9cuVHmOuzB83hLAIddXVt/ 4zsI581TP3YsApUMbrwGy8/JpXZ3FPnVumqNyrfqLPLVAnk9cuDYagl0rqlIR/QaPPFa /oFSKkrPMukMCeIAN97YcjPlZp9D/0ndfDhif80o6Pi6XelSugUVy1PCoc+3A0CyI7C7 tTxA== X-Gm-Message-State: AOAM531RBZVrU7pByGPqy+DeMD8fomV3GDAzcyQfDA+/O0U8SQTeEizI fUSV7svs4GzOieYM+0c1yLNJjnTJ4A== X-Google-Smtp-Source: ABdhPJwH4AD1EmzKDV1IRRLGxbI+4p5v/WkL46QUNZZQlkdR7lMM5J6/Lcl8GKxwkMuHL76FF0f1uw== X-Received: by 2002:ac8:4e8b:0:b0:2f9:cae:cc8b with SMTP id 11-20020ac84e8b000000b002f90caecc8bmr21736031qtp.590.1653418885388; Tue, 24 May 2022 12:01:25 -0700 (PDT) Original-Received: from 3c22fb11fdab.ant.amazon.com (pool-108-30-23-113.nycmny.fios.verizon.net. [108.30.23.113]) by smtp.gmail.com with ESMTPSA id b8-20020ac85bc8000000b002f39b99f69fsm96819qtb.57.2022.05.24.12.01.24 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 May 2022 12:01:24 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Tue, 24 May 2022 11:52:32 -0400") X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier Received-SPF: pass client-ip=2607:f8b0:4864:20::82d; envelope-from=sam.steingold@gmail.com; helo=mail-qt1-x82d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:290207 Archived-At: > * Stefan Monnier [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.