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: Sat, 15 Apr 2023 13:21:53 +0000 Message-ID: <87cz452scu.fsf@posteo.net> References: <87a5zj2vfo.fsf@gmail.com> <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> <87a5zblspg.fsf@posteo.net> <83ildz4vu7.fsf@gnu.org> <87mt3bk31e.fsf@posteo.net> <83r0smg2a6.fsf@gnu.org> <87pm86pgda.fsf@posteo.net> <838retee1z.fsf@gnu.org> <87zg794ebz.fsf@posteo.net> <83mt39ct2m.fsf@gnu.org> <87r0sl2x6j.fsf@posteo.net> <83edolcqwl.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29193"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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 Sat Apr 15 15:23:20 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 1pnfs7-0007Pv-Av for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Apr 2023 15:23:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnfrr-0003RC-N2; Sat, 15 Apr 2023 09:23:03 -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 1pnfrq-0003Qy-5O for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 09: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 1pnfrp-0005Lt-U4 for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 09:23:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pnfrp-0008O7-PD for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 09: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: Sat, 15 Apr 2023 13: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.168156492732151 (code B ref 62720); Sat, 15 Apr 2023 13:23:01 +0000 Original-Received: (at 62720) by debbugs.gnu.org; 15 Apr 2023 13:22:07 +0000 Original-Received: from localhost ([127.0.0.1]:48539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnfqw-0008MU-KL for submit@debbugs.gnu.org; Sat, 15 Apr 2023 09:22:07 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:53283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnfqq-0008Li-Te for 62720@debbugs.gnu.org; Sat, 15 Apr 2023 09:22:05 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 06FB6240232 for <62720@debbugs.gnu.org>; Sat, 15 Apr 2023 15:21:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681564915; bh=4iPQkYAERHZhijhiWSkRO12dULAKr8xffet2hXtxXMY=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=X2mAvwHn0bxYmwLyIW6QlXVXSaJxTDp2XMIngNs/bNdPuVsKpNqA5Xgixlhse6Shr kzvZX8Gvoe4x5wdj+u0PiFZdrss8vvLnYfczO/zJudGmP2b39UTGLKxJmrTqqKjbo9 MfZbNfafrP4q59PCS5VEzL3TE9/a761ux4f4mHTr2o92lZDwE1n3bq5Sx6GQsvOFZZ JtofKveKvcczVL9rQ0hp1TIaseLmu6ZWNeUPgL+Xo8N3eYuT4H0XYpFV5WgDmv+NTQ +2rPx4of+A8wrHhElFNOOs6Cg+oHJn7a5OIox9ZdOzRH8+csMrO1LX51Hn2gUT5XNC /P6diuYC1ghvg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PzDVp0nt6z9rxB; Sat, 15 Apr 2023 15:21:54 +0200 (CEST) In-Reply-To: <83edolcqwl.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 15 Apr 2023 14:43:06 +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:260053 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: joaotavora@gmail.com, monnier@iro.umontreal.ca, 62720@debbugs.gnu.= org >> Date: Sat, 15 Apr 2023 11:37:40 +0000 >>=20 >> Eli Zaretskii writes: >>=20 >> >> I have no preference either way. If you think that package-install is >> >> fine, and Jo=C3=A3o has expressed interest in that route as well, we = might as >> >> well go that way. >> > >> > OK, then let's do that, and thanks. >>=20 >> Great, then just to that we are on the same page, what approach do we >> finally want to decide on? >>=20 >> - User option to enable upgrading built-in packages >> - Prefix argument to enable upgrading built-in packages >> - Always upgrade built-in packages > > The first two on emacs-29, the last one on master (if enough people > think it's a good idea; me, I think we should wait for a while before > deciding). OK, so let us use this change: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Allow-upgrading-built-in-packages-with-package-insta.patch diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index f92afe56b76..842a475290d 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -797,6 +797,17 @@ package-built-in-p (require 'finder-inf nil t) ; For `package--builtins'. (assq package package--builtins)))))) +(defun package--upgradable-built-in-p (package) + "Return non-nil if PACKAGE if the built-in version is used." + (and (not (assq (cond + ((package-desc-p package) + (package-desc-name package)) + ((stringp package) (intern package)) + ((symbolp package) package) + ((error "Unknown package format: %S" package))) + (package--alist))) + (package-built-in-p package))) + (defun package--autoloads-file-name (pkg-desc) "Return the absolute name of the autoloads file, sans extension. PKG-DESC is a `package-desc' object." @@ -2187,7 +2198,9 @@ package-install "Install the package PKG. PKG can be a `package-desc' or a symbol naming one of the available packages in an archive in `package-archives'. When -called interactively, prompt for the package name. +called interactively, prompt for the package name. When invoked +with a prefix argument, the prompt will include built-in packages +that can be upgraded via an archive. Mark the installed package as selected by adding it to `package-selected-packages'. @@ -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 elt)) - (symbol-name (car elt)))) - package-archive-contents)) + (mapcan + (lambda (elt) + (and (or (and current-prefix-arg + (package--upgradable-built-in-p (car elt))) + (not (package-installed-p (car elt)))) + (list (car elt)))) + package-archive-contents) nil t)) nil))) (package--archives-initialize) @@ -2220,6 +2235,8 @@ package-install (unless (or dont-select (package--user-selected-p name)) (package--save-selected-packages (cons name package-selected-packages))) + (when (package--upgradable-built-in-p pkg) + (setq pkg (cadr (assq name package-archive-contents)))) (if-let* ((transaction (if (package-desc-p pkg) (unless (package-installed-p pkg) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable (I intentionally picked this one without the user option since that will probably become unnecessary with Emacs 30+). I believe there was an issue with the name `package--upgradable-built-in-p' and the docstring? >> I argue the last option should be safe. Semantically it would also make >> sense, since invoking the command can be taken to be take to be an >> explicit request, and if it is not what a user wants (I assume that Jo= =C3=A3o >> think this is not probable), then it is easy to revert. >>=20 >> If we decide that this is not acceptable, then we can fall back onto the >> patch that uses a prefix argument or a user option. > > Yes, that is what I think we should install on emacs-29. > > Thanks. --=20 Philip Kaludercic --=-=-=--