GNU bug report logs - #61051
treesit-install-language-grammar can provide the default repository URL

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Dmitry Gutov <dgutov@HIDDEN>; dated Wed, 25 Jan 2023 03:24:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 61051 <at> debbugs.gnu.org:


Received: (at 61051) by debbugs.gnu.org; 25 Jan 2023 12:29:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 25 07:29:27 2023
Received: from localhost ([127.0.0.1]:58546 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pKeu7-0003rS-40
	for submit <at> debbugs.gnu.org; Wed, 25 Jan 2023 07:29:27 -0500
Received: from eggs.gnu.org ([209.51.188.92]:40584)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pKeu3-0003rE-WB
 for 61051 <at> debbugs.gnu.org; Wed, 25 Jan 2023 07:29:25 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pKetx-000253-BT; Wed, 25 Jan 2023 07:29:17 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=z1qHbcOOKdR/0CVw3+igOrVy/d2OGrDvhA6pPOjfenw=; b=P1fxI9hEgw+L
 I+F1o7HJH/5zI0oKSBUaTRBnCQA5/dC+EZNgIUThVEC22wpV4o9bFsdwesddDGxxqh4uAMu0iESrR
 /ox+SHh4r9hpeXalpCIyxbvCmBo7cmF3lp1XRs0IWQj3LwAQYxaN2DCMMYnzufFBbGdFSOyCqUKpn
 4A66ifB+1qSmDN53YxUKk8Cq29Be8VvEUBqXjJ4SEOkGBb0vFj9EkSEOqSanMZRu7p95Bq4Z31ZLQ
 RQeM987z3CoFebfA8LisOek71qSJCT3MZBP/oMk5tP2jS8cY2dPbcTuUtHdWmjOhPfABiw27mDXoG
 YyIoDBUdKFC9OMa+nDSpCg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pKetw-0007kh-FM; Wed, 25 Jan 2023 07:29:16 -0500
Date: Wed, 25 Jan 2023 14:29:30 +0200
Message-Id: <83y1pqg5lh.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <08ecae1f-f937-f0c9-3272-d60f7632be99@HIDDEN> (message from
 Dmitry Gutov on Wed, 25 Jan 2023 05:23:37 +0200)
Subject: Re: bug#61051: treesit-install-language-grammar can provide the
 default repository URL
References: <08ecae1f-f937-f0c9-3272-d60f7632be99@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61051
Cc: 61051 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Wed, 25 Jan 2023 05:23:37 +0200
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> 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): "))

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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61051; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Jan 2023 03:23:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 24 22:23:46 2023
Received: from localhost ([127.0.0.1]:57996 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pKWO2-0006uy-2e
	for submit <at> debbugs.gnu.org; Tue, 24 Jan 2023 22:23:46 -0500
Received: from lists.gnu.org ([209.51.188.17]:51168)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pKWO0-0006ur-8J
 for submit <at> debbugs.gnu.org; Tue, 24 Jan 2023 22:23:44 -0500
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 <raaahh@HIDDEN>) id 1pKWNz-0004Yg-Vf
 for bug-gnu-emacs@HIDDEN; Tue, 24 Jan 2023 22:23:43 -0500
Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <raaahh@HIDDEN>) id 1pKWNx-0004Nx-Qd
 for bug-gnu-emacs@HIDDEN; Tue, 24 Jan 2023 22:23:43 -0500
Received: by mail-ej1-x632.google.com with SMTP id mg12so44185823ejc.5
 for <bug-gnu-emacs@HIDDEN>; Tue, 24 Jan 2023 19:23:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:subject:from:to:content-language
 :user-agent:mime-version:date:message-id:sender:from:to:cc:subject
 :date:message-id:reply-to;
 bh=GZ7u+1BEPY5UGtQx5NT+V5a4EOVCgRO0QhpCevJLHEk=;
 b=NafdrrzuUqGHN4GEf+23VwYviBISfbtKceGYc6MYzq5gO3vh2RWi4y0Qwt0/tY8vTp
 VfRurGGH9KzyNNy0+P801scDD+s9wV4N1ivfXzi1NSwntOhusLbYcx8jvEzzEJuL0eYa
 Mef6FqbX80z6x3jENtlYXSkhzbncXyIGro5EBcz9+2pcrLb9q1UrRmUoq4n4kwmmDfku
 SKV+iy5kg7CMwTBf0X+smXjuMEJ3ONDclwkNTWtBk6onsZTDroWZAafoJPMsLzq7ExaY
 9ahqXjrRgVg4K/SEt0QZNWQMIDfODZVWUT8odYEf/fdeM9SKL22AuOHaxsKVLLlZvrwO
 fekA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:subject:from:to:content-language
 :user-agent:mime-version:date:message-id:sender:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=GZ7u+1BEPY5UGtQx5NT+V5a4EOVCgRO0QhpCevJLHEk=;
 b=AmsGn54WBtLuKkod0qkM8p8TcLkaMtuALjN+MBm48HOftoMOpj41KK/B9z550KG9Fh
 R855csnVk567gXXDvrbkwFuCXkwl9LF1Q9AlJqvnaRUoiOFAnOxpNmCA1UJ1oAV8N+OM
 WKpi3fLrYbSAhZicCnXQHTpYXntI/yEcXZvgIHVTO0z9pXwHGavl6aaghUUUz+vZ9q9u
 Js0Qu86U33OjQH/zQDIPZrm79dJDDDzJ5xW3HzX6ORdSDJkym9TeFOjF1rcj4GF4fjut
 9XBfF2WDQDXxqOS1NYVnAhMh0bfi4vp2zObddrTEOui7nCuKiDvjuURQPY5SxU3z9r9V
 Q0hQ==
X-Gm-Message-State: AFqh2ko2bRbp1/BScXXOi6QSUe6ObCarim9CyYMi7aCh7PA05ZZFBIvI
 upAwwnJs+eGg93naDw2pdXZ88i0WY00=
X-Google-Smtp-Source: AMrXdXtlXoIG1kxqPA+HYDfQ2kJlMVN7tyhJh0duVqK3VcbjKldstaNN9DXIFZkrJC+ybfN/pwY4vg==
X-Received: by 2002:a17:907:8a1d:b0:84d:3822:2fc7 with SMTP id
 sc29-20020a1709078a1d00b0084d38222fc7mr42003356ejc.77.1674617019942; 
 Tue, 24 Jan 2023 19:23:39 -0800 (PST)
Received: from [192.168.0.2] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id
 kf6-20020a17090776c600b00877df3eea5fsm1683782ejc.163.2023.01.24.19.23.39
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 24 Jan 2023 19:23:39 -0800 (PST)
Message-ID: <08ecae1f-f937-f0c9-3272-d60f7632be99@HIDDEN>
Date: Wed, 25 Jan 2023 05:23:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.4.2
Content-Language: en-US
To: bug-gnu-emacs@HIDDEN
From: Dmitry Gutov <dgutov@HIDDEN>
Subject: treesit-install-language-grammar can provide the default repository
 URL
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=2a00:1450:4864:20::632;
 envelope-from=raaahh@HIDDEN; helo=mail-ej1-x632.google.com
X-Spam_score_int: -15
X-Spam_score: -1.6
X-Spam_bar: -
X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.149,
 FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

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): "))




Acknowledgement sent to Dmitry Gutov <dgutov@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#61051; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 25 Jan 2023 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.