From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65386: [PATCH] ; Refine some 'package-vc' docstrings Date: Sun, 20 Aug 2023 18:22:28 +0200 Message-ID: References: <83msymyfun.fsf@gnu.org> <83h6ouxn7m.fsf@gnu.org> <871qfyunan.fsf@posteo.net> <87ttstucss.fsf@posteo.net> <87edjxu2c9.fsf@posteo.net> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13671"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 65386@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 20 18: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 1qXlCy-0003Ng-SC for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Aug 2023 18:23:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qXlCg-0001XL-80; Sun, 20 Aug 2023 12:23:02 -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 1qXlCe-0001X5-Sj for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 12:23:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qXlCe-0005n6-Jv for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 12:23:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qXlCg-0003Gi-8o for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 12:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Aug 2023 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65386 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65386-submit@debbugs.gnu.org id=B65386.169254855912534 (code B ref 65386); Sun, 20 Aug 2023 16:23:02 +0000 Original-Received: (at 65386) by debbugs.gnu.org; 20 Aug 2023 16:22:39 +0000 Original-Received: from localhost ([127.0.0.1]:54687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXlCJ-0003G5-6F for submit@debbugs.gnu.org; Sun, 20 Aug 2023 12:22:39 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:44370 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXlCG-0003Fx-QC for 65386@debbugs.gnu.org; Sun, 20 Aug 2023 12:22:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1692548554; bh=SS5bvqpZYvtRXXOYFw3nBdYo/WmmEwEGm7HopSZQffk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Uv8LF7UmVVbEKD4w8QDCVSS/jwhAVXDhVqrrsXBvvzL5W83mZD0SDFcpiOtmfcypN I/ZAMVTovo4baIjQ/BIT8jVUSkQ8MLDxQ5RuNkKzjC/l4REWaILcQjb8t3cufvnvLx 76CeAa85EtIPCNo7XCrlv+rVb1tTbH/mt0h/oI4s21L84WYYf2syOdumH1HeHJYgjo G4a1/GkbOjdlApTmjeYrpQN9aSMksoB8qaCUihnuwgsgARTElulhHkOJ8ZUF6CRKIb Tb6xInsQ9UqgdPtzf0FXh6sU5qkAcKfQpSl2Q4hXJw9I0fwQoUBOZ+//gFfZUvmc2k 1OjOBGXYeeWMA== In-Reply-To: <87edjxu2c9.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 20 Aug 2023 16:04:54 +0000") 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:268007 Archived-At: Philip Kaludercic writes: > Eshel Yaron writes: > >>> Also, would it make sense to determine this at compile-time? On the >>> other hand, if a VC backend is installed later on from ELPA, we would >>> want the custom type to reflect this. >> >> Yes, I couldn't find a way to defer computing the set of candidates to >> "customization type", I'm not sure if that even makes total sense. I >> think it's not that crucial since someone adding a VC backend and >> immediately trying to customize these options seems to me like a very >> minor edge case, and we had the same issue prior to my patch anyhow. > > Likely yes, but if we have two mostly equivalent solutions, I think that > flexibility without having to restart Emacs is preferable to performance. > Hmm I'm not sure I completely follow. Which two solutions do you have in mind? I agree that it would be nice have the `:type` updated if the user adds a relevant VC backend, but I don't think `defcustom` supports something like that. How do you propose to achieve that flexibility? > [...] > >> From 8a339d3bffe81f80e7e968505c40855d6598b8ac Mon Sep 17 00:00:00 2001 >> From: Eshel Yaron >> Date: Sun, 20 Aug 2023 16:20:54 +0200 >> Subject: [PATCH] ; Refine 'defcustom' types in 'package-vc' >> >> Only include VC backends that support cloning in the ':type' of >> 'package-vc-heuristic-alist' and 'package-vc-default-backend'. >> >> * lisp/emacs-lisp/package-vc.el (package-vc--cloning-backend-p) >> (package-vc--backends): New functions. >> (package-vc-heuristic-alist, package-vc-default-backend): Use it. >> --- >> lisp/emacs-lisp/package-vc.el | 13 +++++++++++-- >> 1 file changed, 11 insertions(+), 2 deletions(-) >> >> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el >> index a3762d252b0..44a4624e49f 100644 >> --- a/lisp/emacs-lisp/package-vc.el >> +++ b/lisp/emacs-lisp/package-vc.el >> @@ -62,6 +62,15 @@ package-vc >> (defconst package-vc--elpa-packages-version 1 >> "Version number of the package specification format understood by package-vc.") >> >> +(defun package-vc--cloning-backend-p (be) >> + "Return non-nil if the VC backend BE supports cloning repositories." >> + (or (vc-find-backend-function be 'clone) >> + (alist-get 'clone (get be 'vc-functions)))) >> + >> +(defun package-vc--backends () >> + "Return a list of VC backends suitable for cloning package VCS repositories." >> + (seq-filter #'package-vc--cloning-backend-p vc-handled-backends)) > > Do you think that these utility functions are useful enough to have in > general, or would it be better to just define a defconst once that > generates the `(choice ...)' object? > I think these are nice to have, but I don't mind removing them in favor of a `defconst` (or a `define-widget` for that matter) if you think that's better.