Subject: bug#61051: closed (Re: bug#61051: treesit-install-language-grammar can provide the default repository URL)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 25 Jan 2023 15:24:03 +0000

Your bug report

#61051: treesit-install-language-grammar can provide the default repository URL

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
61051: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61051
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#61051: treesit-install-language-grammar can provide the default repository URL
From: Dmitry Gutov <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked]
Date: Wed, 25 Jan 2023 17:23:31 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

On 25/01/2023 16:50, Eli Zaretskii wrote:
>> Date: Wed, 25 Jan 2023 16:00:48 +0200
>> Cc:[email-masked]
>> From: Dmitry Gutov<[email-masked]>
>>
>>>> -        "Enter the URL of the Git repository of the language grammar: ")
>>>> +        "Enter the URL of the Git repository of the language grammar: "
>>>> +        (format"https://github.com/tree-sitter/tree-sitter-%s"   lang))
>>>>            (empty-string-to-nil
>>>>             (read-string
>>>>              "Enter the tag or branch (default: default branch): "))
>>> Sounds good, but wouldn't we confuse users in those cases where the
>>> Tree-sitter site doesn't have a grammar?  Would it be perhaps feasible
>>> to probe first that a Git repository at the URL exists?
>> Sure, how about this:
> LGTM, thanks.

Installed, thank you.

Subject: treesit-install-language-grammar can provide the default repository URL
From: Dmitry Gutov <[email-masked]>
To: [email-masked]
Date: Wed, 25 Jan 2023 05:23:37 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

The format https://github.com/tree-sitter/tree-sitter-%s will work for a 
lot of languages, and the user won't even have to search for the address.

The patch can look like this:

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 660039cc7cc..c1b98d085e8 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -2708,7 +2708,8 @@ treesit--install-language-grammar-build-recipe
        (list
         lang
         (read-string
-        "Enter the URL of the Git repository of the language grammar: ")
+        "Enter the URL of the Git repository of the language grammar: "
+        (format "https://github.com/tree-sitter/tree-sitter-%s" lang))
         (empty-string-to-nil
          (read-string
           "Enter the tag or branch (default: default branch): "))