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.devel Subject: Re: feature/package-vc has been merged Date: Sun, 06 Nov 2022 08:15:59 +0000 Message-ID: <87mt948pmo.fsf@posteo.net> References: <164484721900.31751.1453162457552427931@vcs2.savannah.gnu.org> <87zgdivc3f.fsf@posteo.net> <874jvqv2u3.fsf@posteo.net> <875yg6qtbl.fsf@posteo.net> <87ilk33lqk.fsf@posteo.net> <87mt9epqlk.fsf@posteo.net> <87ilk1bgvd.fsf@posteo.net> <87edupbdp0.fsf@posteo.net> <875yg1bc02.fsf@posteo.net> <878rkxgpms.fsf@posteo.net> <87sfiyk3a2.fsf_-_@posteo.net> 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="26627"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Richard Stallman , emacs-devel@gnu.org To: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 06 09:17:03 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 1orapy-0006hZ-2l for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Nov 2022 09:17:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orapB-0000P8-TS; Sun, 06 Nov 2022 03:16:13 -0500 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 1orapA-0000Oz-J1 for emacs-devel@gnu.org; Sun, 06 Nov 2022 03:16:12 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orap8-0006Ib-6E for emacs-devel@gnu.org; Sun, 06 Nov 2022 03:16:12 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id DF8A6240104 for ; Sun, 6 Nov 2022 09:16:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667722567; bh=QMlQ1J6QT1WDSbtAsf87CeGpwV4qlQkqrnNI4FW5S64=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=kfOMboMrB17YllHzylGfAnKlsxGPTewewuSGShlgW1z77FFRC7G/C4mOH3hF8EVVe f30jTKcPgRr2UcRspZRZa51WSN+D/IMKQN+uNaq4sAaQ8RR4FQ3TQTgIKEeTd1fG10 vg27IeC9PYc68Wqc0IlYw+B2sH7Vq7YH4VNY4kC9H6nhVTjjloHyl/NlAFtN1M8Jjt RSwCrYi3AvM+IO4e258RgmA/8GT7zYQcwo8VBKqTDgiN8pKo5wKpoxWX0mMYmT79dK SA1T8CQnj/bhywp04YmvHO8kFNRmnOT4CI7GrjBXDb5djkRYi3zBLr9B52HaP/GIJD /klGirTMYA8vg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N4nHq0Shcz6tqw; Sun, 6 Nov 2022 09:16:04 +0100 (CET) In-Reply-To: ("Rudolf =?utf-8?Q?Adamkovi=C4=8D=22'?= =?utf-8?Q?s?= message of "Sun, 06 Nov 2022 01:23:05 +0100") Autocrypt: addr=philipk@posteo.net; keydata= mQGNBGLfygUBDADVznbke6w0n9nE42xb+ZggbBy0IYRkkru/K+NA67523YTl2DoR2a5OMW90w7L9 KDtX2Mp34JN/6jVOSVC07VUbHVu6/exoGKixkiTpGhBPy5tUUJoxQKqLrzVQhN3fIyvg1oyHXKZm QGkUeevV0wjj4++xfjmcP235YvDh3TF8HC9t5KxIQIbhWnQm4ZyDkpWWS2CmdNttlj2+eH+51WLL bgx2bcwTmqrs079Q3hgF3yh44bBEmp9MgFjiZldOY2my0/ZSeucRxYmiM0vbJEBQgZV/MvA3gTxe 7ibV3ii7AyoYA8FiFDP98S/R2y5Nfq3ez9B7qeqtpSNseQHOU7h8Y5VV01a71ZszENAmbbwsldb9 j+HRLke7rn6mswDZl1qA/9ZFRzliFOdQtS1878XjraY+h5jfjvxaFVK23prGGVrrKv0LPWavoFUr nsjeHEZhYezBKhC2PwvRtXm01S3rkNbwm9pj0tfLSDW+1pT+6eZWptfQCXF2oEvgfKSTASUAEQEA AbQmUGhpbGlwIEthbHVkZXJjaWMgPHBoaWxpcGtAcG9zdGVvLm5ldD6JAdQEEwEKAD4WIQRxJuHe LwzjXHcL7QHyw8xRPbifZgUCYt/KBQIbAwUJA8JnAAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAK CRDyw8xRPbifZkH+DACmCKmhrYgcv2i6dj3vRCVINaLtKUODTna/wAmP20WRKPhqvqvKNUx/wzpT aZrXIxpxOU2xawRWeHhWUktxS+W9L3xTACeR0gf5gomCxD9RuBTIohzWDkQt5rk8QwLqx5rAy5 Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299243 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rudolf Adamkovi=C4=8D writes: > Rudolf Adamkovi=C4=8D writes: > >> OMG, the time has come! Thank you. > > I would like to share first-time user experience with you. Perhaps you > will find it interesting. Here it goes: > > I found `package-vc-selected-packages' in seconds thanks to its familiar > name, nicely matching `package-selected-packages'. Well done! It > surprised me, though, that the variable does not accept bare package > names, such as `modus-themes' instead of `(modus-themes . nil)'. It would be trivial to implement, the main issue is that I wanted to use `alist' as the user option type. If instead the type were to be replaced with some (repeat (choice symbol (cons symbol string) ...)) it might work. But keep in mind that (modus-themes . nil) is the same as (modus-themes). > Then I looked for `package-vc-install-selected-packages`, and troubles > started. I found no such function, so I decided to consult the > documentation for `package-vc-selected-packages' which says: > > You can also use the function =E2=80=98package-vc-selected-packages=E2= =80=99 to apply > the changes. > Confused, I could not find any such function. I also tried `M-x > package-vc TAB' but that did not help either. So, I read the source > code, I found `package-vc-ensure-packages', and that worked. Phew! Right, that was a mistake in the documentation that Eli also pointed out. If you think the name-symmetry between package and package-vc is helpful, we could rename that one to `package-vc-install-selected-packages'. > I then added `package-vc-ensure-packages' to my Emacs init file, but > Emacs did not launch cleanly, for it could not find the function. So, I > added an explicit `require' for `package-vc'. What I had in mind was for `package-vc-selected-packages' to be used as is. It is an autoloaded option with a custom setter that installs all "selected packages" as a side effect. As the manual says, all you need to do is write (setopt package-vc-selected-packages '((modus-themes))) Should that be highlighted more explicitly in the documentation? I had actually initially hesitated in exposing `package-vc-ensure-packages' as a public function at all, let alone auto-loading it. > Finally, it all worked. I installed Modus Themes! > > Next, I looked for `package-vc-update', but found nothing. I then found > `package-vc-refresh' but that sounded like `package-refresh-contents' > which does not update packages. Confusing! Hmm, I forgot about `package-refresh-contents'. What `package-vc-refresh' does is package installing dependencies, generating autoloads, building the documentation, byte compiling, etc. It exists so that if the user changes something, they can "activate" their changes without having to do all those things automatically. > Still, I ran the `package-vc-refresh' function, and it prompted me with > "Refresh package:". I hit RET, just to try something, and it failed > with > > funcall-interactively: Wrong number of arguments: # package-vc-refresh>, 0 Interesting... > So, I tried again with "modus-themes", which I installed with > `package-vc-ensure-packages', and got > > execute-extended-command: Wrong type argument: listp, > #s(package-desc modus-themes (3 0 0) "Elegant, highly legible and > customizable themes" ((emacs (27 1))) vc nil > "/Users/salutis/.emacs.d/elpa/modus-themes" ((:url > . "https://git.sr.ht/~protesilaos/modus-themes") (:keywords "faces" > "theme" "accessibility") (:maintainer "Modus-Themes Development" > . "~protesilaos/modus-themes@lists.sr.ht") (:authors ("Protesilaos > Stavrou" . "info@protesilaos.com")) (:commit > . "f1149c18005d31638b3701f9a89819b133b4360e")) nil) Ah, the interactive spec for `package-vc-refresh' is missing a (list ...). Is trying to apply a package description as an argument list, which doesn't make sense. This will fix the issue: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index a0b4b03118..127a7e073f 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -692,7 +692,7 @@ package-vc-install-from-checkout (defun package-vc-refresh (pkg-desc) "Refresh the installation for package given by PKG-DESC. Interactively, prompt for the name of the package to refresh." - (interactive (package-vc--read-pkg "Refresh package: ")) + (interactive (list (package-vc--read-pkg "Refresh package: "))) (package-vc--unpack-1 pkg-desc (package-desc-dir pkg-desc))) (defun package-vc--read-pkg (prompt) --=-=-= Content-Type: text/plain Perhaps the function should be called `-reinstall', or `-reactivate', but I am uncertain about all these names too. > Ignoring the refresh woes, I suggest the following design changes: > > - allow strings in `-selected-packages' if possible Can be done. > - make `-ensure-packages' interactive for `M-x' Can be done. > - rename `-ensure-' to `-install-selected-' for consistency Can be done. > - auto-load `-install-selected-packages' for common use Not a fan of that, but I guess it can be done. > - rename `-refresh' to `-update' for consistency That would be wrong, because `package-vc-refresh' doesn't update the package. There is `package-vc-update' and `package-update' (that do the same thing for source packages). Maybe `package-vc-update' can be made interactive too and made to only prompt for source packages. > - add `-update-all' for consistency That already exists, in `package-update-all'. It will also update source packages. What you have in mind would be a `package-vc-update-all' that would only update all the source packages. > - fix the nonexistent function reference in the documentation Right, we are on that already. > Then, the existing users of `package.el' will know how to use a large > part of `package-vc.el' without needing to learn that "ensure" means > "install-selected", "refresh" means "update", and so on. I agree on these points. > Rudy --=-=-=--