From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#62720: 29.0.60; Not easy at all to upgrade :core packages like Eglot Date: Thu, 13 Apr 2023 11:23:12 +0000 Message-ID: <871qkom3fj.fsf@posteo.net> References: <87a5zj2vfo.fsf@gmail.com> <87h6tlleg0.fsf@gmail.com> <8335558qc7.fsf@gnu.org> <83sfd5761f.fsf@gnu.org> <87zg7djrgr.fsf@gmail.com> <83o7nt73za.fsf@gnu.org> <83mt3d73c2.fsf@gnu.org> <87r0sptinq.fsf@posteo.net> <83jzyh706c.fsf@gnu.org> <875ya1tdwf.fsf@posteo.net> <83edop6sdy.fsf@gnu.org> <831qkp6o0i.fsf@gnu.org> <83wn2h5825.fsf@gnu.org> <87wn2gkhzr.fsf@posteo.net> <83cz485oxi.fsf@gnu.org> <87leiwdyff.fsf@posteo.net> <834jpk5hih.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18742"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 62720@debbugs.gnu.org, joaotavora@gmail.com, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 13 13:23:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1pmv2s-0004jb-9G for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Apr 2023 13:23:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pmv2e-0007Fi-7v; Thu, 13 Apr 2023 07:23:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmv2c-0007FG-N3 for bug-gnu-emacs@gnu.org; Thu, 13 Apr 2023 07:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pmv2c-0006t1-FT for bug-gnu-emacs@gnu.org; Thu, 13 Apr 2023 07:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pmv2b-00034l-PY for bug-gnu-emacs@gnu.org; Thu, 13 Apr 2023 07:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Apr 2023 11:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62720 X-GNU-PR-Package: emacs Original-Received: via spool by 62720-submit@debbugs.gnu.org id=B62720.168138497311784 (code B ref 62720); Thu, 13 Apr 2023 11:23:01 +0000 Original-Received: (at 62720) by debbugs.gnu.org; 13 Apr 2023 11:22:53 +0000 Original-Received: from localhost ([127.0.0.1]:42714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pmv2T-000340-4i for submit@debbugs.gnu.org; Thu, 13 Apr 2023 07:22:53 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:44791) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pmv2Q-00033m-Kq for 62720@debbugs.gnu.org; Thu, 13 Apr 2023 07:22:51 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id BA3F924030E for <62720@debbugs.gnu.org>; Thu, 13 Apr 2023 13:22:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681384964; bh=ILYMO3jIQZ+Wblct0fqJOm9+bHBdYMOSrT3YIpgjjaQ=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=GDISsSUWQ4rIythtKp/uN3ZyOPJKzSYCOS3DIoI2MRwIjNkLwNxKAWbQTcKUs40Bk e2ryXjeQFj7c+upu4jqmjiGaLeg1tYSXJ+AMk9/yWtVcBTElGkNV97olq5GRYF1wWw 3B8uksPBjurnhJLH9HLxKyEy1MmF3GwYXGhQpX/b58uK9/uUrevgbzsRgyvu4LFSP8 o1aEGcLug/y7d7WETsntWuZVsHZM3VhcJIEXkcePavP+Ph/snbwNIizeTPf1MpfNgN F8eROCHHvMHoBKN2rM61esKoLsDJNQ0Ncb2Q1RnHPY6SNZ3aecXDswqPfc+BRGHtXY RRKama+GajxuA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Pxxy94Q9Bz6tx0; Thu, 13 Apr 2023 13:22:41 +0200 (CEST) In-Reply-To: <834jpk5hih.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 13 Apr 2023 11:11:02 +0300") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259850 Archived-At: Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: joaotavora@gmail.com, monnier@iro.umontreal.ca, 62720@debbugs.gnu.= org, >> larsi@gnus.org >> Date: Thu, 13 Apr 2023 07:38:28 +0000 >>=20 >> > Thanks. This is almost on-target, but it modifies >> > package-compute-transaction. Is that necessary? >>=20 >> I have found an alternative that doesn't change the way >> `package-compute-transaction' works, but requires a small change in >> `package-install': > > Thanks. > >> @@ -2205,11 +2218,13 @@ package-install >> (package--archives-initialize) >> (list (intern (completing-read >> "Install package: " >> - (delq nil >> - (mapcar (lambda (elt) >> - (unless (package-installed-p (car e= lt)) >> - (symbol-name (car elt)))) >> - package-archive-contents)) >> + (mapcan >> + (lambda (elt) >> + (and (or (and current-prefix-arg >> + (package--upgradable-built-in-p (c= ar elt))) >> + (not (package-installed-p (car elt)))) >> + (list (car elt)))) >> + package-archive-contents) > > Why did the original code use symbol-name, but the new one doesn't? To my knowledge, completing-read given a collection of symbols will use the symbol names as candidates, or is this more complicated? >> @@ -2221,11 +2236,16 @@ package-install >> (package--save-selected-packages >> (cons name package-selected-packages))) >> (if-let* ((transaction >> - (if (package-desc-p pkg) >> - (unless (package-installed-p pkg) >> - (package-compute-transaction (list pkg) >> - (package-desc-reqs pk= g))) >> - (package-compute-transaction () (list (list pkg)))))) >> + (cond >> + ((package--upgradable-built-in-p pkg) >> + (let ((desc (cadr (assq name package-archive-contents)= ))) >> + (package-compute-transaction >> + (list desc) (package-desc-reqs desc)))) >> + ((package-desc-p pkg) >> + (and (not (package-installed-p pkg)) >> + (package-compute-transaction >> + (list pkg) (package-desc-reqs pkg)))) >> + ((package-compute-transaction () (list (list pkg))))))) > > I think the first condition of 'cond' should be > > ((and current-prefix-arg (package--upgradable-built-in-p pkg)) > > to make sure we don't affect the non-prefix-arg invocations in any > way. The issue here is that this breaks the non-interactive invocations like (package-install 'eglot), unless they invoke the function while binding `current-prefix-arg', which I don't think is a common practice. >> Note that (package-install 'eglot) does download code, but I believe >> that this is the correct approach and would align with what Jo=C3=A3o >> wanted. > > I'm not sure I follow: which code does the above download? I did not change any of the code that downloads anything, all this does is prompt the user for built-in packages when invoked interactively with a prefix argument and if package-install is invoked with a built-in package, then it will switch to the ELPA version. This will not happen in interactive usage, since `completing-read' is called with REQUIRE-MATCH.