GNU bug report logs - #79862
Please add option to control where treesit installs grammars

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: Jonas Bernoulli <jonas@HIDDEN>; Done: Juri Linkov <juri@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 31.0.50, send any further explanations to 79862 <at> debbugs.gnu.org and Jonas Bernoulli <jonas@HIDDEN> Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 79862) by debbugs.gnu.org; 30 Nov 2025 18:15:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 30 13:15:42 2025
Received: from localhost ([127.0.0.1]:41808 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vPlxV-0005Gt-UJ
	for submit <at> debbugs.gnu.org; Sun, 30 Nov 2025 13:15:42 -0500
Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202]:37278)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>)
 id 1vPlxR-0005Ga-4x; Sun, 30 Nov 2025 13:15:40 -0500
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4dKFZT4X3mz9t1k;
 Sun, 30 Nov 2025 19:15:29 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1764526529;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=if6svaw0FXXyzApPyAOqEABvfDQSFd/i1aaBD52JF5M=;
 b=pXtqOyCdXqEhcibegmBiICUm2V7grESNlvTFuuUi1srAE9b0D5ICI/Vb68oxNnFfB1DkS2
 KyfZbJ4GyVfXAK+NZHQl5MQ+wECb1qTCLUq3UnimpbbAY1skIlbdAhUgPoo9LU8sInlbFz
 ZXIAI7kVFs1PJU8ZgcJDbA/wQQZSG6MKrYHvhZah7bGXtIfFMz5hs2T0t7a3xF38ItA3N3
 Ji9ZlwLrBkRoly76lG3xqbp3ZWxY781LCzRS5JZbAfmUOjUE1KeCx2Orb0n+tR4vqk2Ngh
 0NmxZaPScTyepW2JpviK1qspPlqjp3L1sQf4fVHNNz4xUNGGms7YNGoZyPx6oA==
From: Juri Linkov <juri@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <87v7isfxlo.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
 <86fra6h329.fsf@HIDDEN> <87v7j1ilj2.fsf@HIDDEN>
 <86tsyle2de.fsf@HIDDEN> <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
 <87ldjvctos.fsf@HIDDEN>
 <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN>
 <865xaye2ji.fsf@HIDDEN> <874iqfs5wy.fsf@HIDDEN>
 <9E8F265F-8B4E-41E5-B62B-8E79C18674F7@HIDDEN>
 <87345yy5zz.fsf@HIDDEN> <87bjkmjv4v.fsf@HIDDEN>
 <87y0no7mtf.fsf@HIDDEN> <87v7isfxlo.fsf@HIDDEN>
Date: Sun, 30 Nov 2025 20:14:50 +0200
Message-ID: <87qztf5qw5.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, Yuan Fu <casouri@HIDDEN>, jonas@HIDDEN,
 Eli Zaretskii <eliz@HIDDEN>, 79862 <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: -1.7 (-)

close 79862 31.0.50
thanks

>> I thought that maybe 'always' needs the same treatment,
>> and thanks for confirming it does indeed.  However, it's not clear
>> what to do with 'always'.  Should it always install to the first
>> directory from treesit-extra-load-path without asking any questions?
>
> Yes, this would meet my expectations. If treesit-extra-load-path is not
> customized, it will install to ~/.config/tree-sitter/ without asking any
> questions, and if the variable is customized to a directory it should
> install to the given directory.

So now this is pushed and closed.




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

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


Received: (at 79862) by debbugs.gnu.org; 29 Nov 2025 19:27:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 29 14:27:44 2025
Received: from localhost ([127.0.0.1]:59889 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vPQbf-0002UX-IG
	for submit <at> debbugs.gnu.org; Sat, 29 Nov 2025 14:27:43 -0500
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:34327 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1vPQbb-0002U9-Cp
 for 79862 <at> debbugs.gnu.org; Sat, 29 Nov 2025 14:27:41 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date:
 References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:
 Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
 Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
 List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=94Qt/j8C6a/GlcdahTxH/Rvb+7oaeIpNjQSpSPqHEFs=; b=iCLNgbPDxkQ9m3PrYXA/HH7e+w
 +efKL+jWRz4xTbvjKGquTgODSIfjtVaAlzZkAs9c90O4mHI7sy/P/qWOE6zchGmUgacrNkxDrX027
 LuH7bEb9aDUuUtoiFSUqRsVYZwSASgksjVTkzkZP6crVLTftmHpsXpu8QIx29d7BZJrc=;
From: Daniel Mendler <mail@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <87y0no7mtf.fsf@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
 <86fra6h329.fsf@HIDDEN> <87v7j1ilj2.fsf@HIDDEN>
 <86tsyle2de.fsf@HIDDEN> <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
 <87ldjvctos.fsf@HIDDEN>
 <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN>
 <865xaye2ji.fsf@HIDDEN> <874iqfs5wy.fsf@HIDDEN>
 <9E8F265F-8B4E-41E5-B62B-8E79C18674F7@HIDDEN>
 <87345yy5zz.fsf@HIDDEN> <87bjkmjv4v.fsf@HIDDEN>
 <87y0no7mtf.fsf@HIDDEN>
Date: Sat, 29 Nov 2025 20:27:31 +0100
Message-ID: <87v7isfxlo.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, Yuan Fu <casouri@HIDDEN>, jonas@HIDDEN,
 Eli Zaretskii <eliz@HIDDEN>, 79862 <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: -1.0 (-)

Juri Linkov <juri@HIDDEN> writes:

>> I have set `treesit-auto-install-grammar' to `always', but I still want
>> to customize the treesitter installation directory. It seems your change
>> only addresses the values `ask' and `ask-dir' of
>> `treesit-auto-install-grammar'? Thanks!
>
> Yes, I thought that maybe 'always' needs the same treatment,
> and thanks for confirming it does indeed.  However, it's not clear
> what to do with 'always'.  Should it always install to the first
> directory from treesit-extra-load-path without asking any questions?

Yes, this would meet my expectations. If treesit-extra-load-path is not
customized, it will install to ~/.config/tree-sitter/ without asking any
questions, and if the variable is customized to a directory it should
install to the given directory.




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

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


Received: (at 79862) by debbugs.gnu.org; 29 Nov 2025 17:48:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 29 12:48:33 2025
Received: from localhost ([127.0.0.1]:59262 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vPP3h-0004kF-97
	for submit <at> debbugs.gnu.org; Sat, 29 Nov 2025 12:48:33 -0500
Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]:37574)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vPP3e-0004js-R7
 for 79862 <at> debbugs.gnu.org; Sat, 29 Nov 2025 12:48:31 -0500
Received: from smtp202.mailbox.org (smtp202.mailbox.org
 [IPv6:2001:67c:2050:b231:465::202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4dJd1g0zPmz9t8m;
 Sat, 29 Nov 2025 18:48:23 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1764438503;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=4JQjzudvF6LnFmcsaLQgkeIULP5A4PvYnXQVusc0Ysk=;
 b=2ALkACeg3YR6NDXNI3ViED6/JZNppur52o2Ultr+dvXZwxkfjYw0DwRD3pUDW/HhF2Zaza
 BUeRML0wvCZvIiE1NkyoDdsQMA3I7gblMVTpKK3mO7mJ1OllBI8KIQX3KOGHyXnUm9WeEy
 J231bq8OsMdgyfKNrzdWe6fmh+L6ZAlE/gtF0i/vmYmj4N5LwOk64BturPxExFOEibzP9Z
 MR0tv2ChYRcSNWOV1HanaowLptZPjM7x2GaubnSHWhq7vT7BMn+zmPZQAVZ3aP0azvGq9t
 RDmoQaJ1kfGi4hO2+AsaPIa8Nltb3gvmRlTM4isammlNQ51XsZOfnUoPOKIEMg==
Authentication-Results: outgoing_mbo_mout; dkim=none;
 spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates
 2001:67c:2050:b231:465::202 as permitted sender)
 smtp.mailfrom=juri@HIDDEN
From: Juri Linkov <juri@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <87bjkmjv4v.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
 <86fra6h329.fsf@HIDDEN> <87v7j1ilj2.fsf@HIDDEN>
 <86tsyle2de.fsf@HIDDEN> <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
 <87ldjvctos.fsf@HIDDEN>
 <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN>
 <865xaye2ji.fsf@HIDDEN> <874iqfs5wy.fsf@HIDDEN>
 <9E8F265F-8B4E-41E5-B62B-8E79C18674F7@HIDDEN>
 <87345yy5zz.fsf@HIDDEN> <87bjkmjv4v.fsf@HIDDEN>
Date: Sat, 29 Nov 2025 19:47:40 +0200
Message-ID: <87y0no7mtf.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4dJd1g0zPmz9t8m
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, Yuan Fu <casouri@HIDDEN>, jonas@HIDDEN,
 Eli Zaretskii <eliz@HIDDEN>, 79862 <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: -1.7 (-)

> I have set `treesit-auto-install-grammar' to `always', but I still want
> to customize the treesitter installation directory. It seems your change
> only addresses the values `ask' and `ask-dir' of
> `treesit-auto-install-grammar'? Thanks!

Yes, I thought that maybe 'always' needs the same treatment,
and thanks for confirming it does indeed.  However, it's not clear
what to do with 'always'.  Should it always install to the first
directory from treesit-extra-load-path without asking any questions?




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

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


Received: (at 79862) by debbugs.gnu.org; 28 Nov 2025 10:42:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 28 05:42:51 2025
Received: from localhost ([127.0.0.1]:44880 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vOvwB-0005CI-4t
	for submit <at> debbugs.gnu.org; Fri, 28 Nov 2025 05:42:51 -0500
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:54277 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1vOvw8-0005Bk-6Y
 for 79862 <at> debbugs.gnu.org; Fri, 28 Nov 2025 05:42:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Transfer-Encoding:Content-Type:
 MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Sender
 :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
 Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:
 List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=PSiBXosj6tvhBMaA0XZQB0LVTBKKbD6tAUsdwTkWiXE=; b=zHD/IwZEf6bGcGZMyY/MqhGKTJ
 Pnjh8etiqvJVlaFQDIHq7K4oPa6eGvvhd6/VNbiuXjtlS07a/1GZ6hFPZNoGsxWoFNmg4+u4zMtTd
 3QL9AKQZrpuj/wn561m57DLNRi4LwoxMCTK7UsIoDnDTGustFgtWPIQ3p6rYB9DRTSTM=;
From: Daniel Mendler <mail@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <87345yy5zz.fsf@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
 <86fra6h329.fsf@HIDDEN> <87v7j1ilj2.fsf@HIDDEN>
 <86tsyle2de.fsf@HIDDEN> <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
 <87ldjvctos.fsf@HIDDEN>
 <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN>
 <865xaye2ji.fsf@HIDDEN> <874iqfs5wy.fsf@HIDDEN>
 <9E8F265F-8B4E-41E5-B62B-8E79C18674F7@HIDDEN>
 <87345yy5zz.fsf@HIDDEN>
Date: Fri, 28 Nov 2025 11:42:40 +0100
Message-ID: <87bjkmjv4v.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, Yuan Fu <casouri@HIDDEN>, jonas@HIDDEN,
 Eli Zaretskii <eliz@HIDDEN>, 79862 <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: -1.0 (-)

Juri Linkov <juri@HIDDEN> writes:

>>>>>> Since 'treesit-extra-load-path' is not a customizable option,
>>>>>> we can't save it automatically to user's init files
>>>>>> (saving even user options automatically is too nasty).
>>>>>>=20
>>>>>> So let's add a new user option e.g. 'treesit-install-grammar-directo=
ry',
>>>>>> and treat its value as if it's at the beginning of 'treesit-extra-lo=
ad-path'.
>>>>>> Also it will be used as the default location by 'treesit-ensure-inst=
alled=E2=80=99.
>>>>>=20
>>>>> We can declare treesit-extra-load-path as a custom option in
>>>>> treesit.el. Correct me if I'm wrong but I think that=E2=80=99s a vali=
d thing
>>>>> to do?
>>>>=20
>>>> No, variables defined in C are made defcustom's in cus-start.el.
>>>=20
>>> Ok, let's make the variable customizable (not sure about
>>> adding the version since the variable is old):
>>
>> Agree!
>
> So now pushed.  Not sure if this request can be closed,
> or more tweaks are necessary.

I have set `treesit-auto-install-grammar' to `always', but I still want
to customize the treesitter installation directory. It seems your change
only addresses the values `ask' and `ask-dir' of
`treesit-auto-install-grammar'? Thanks!

Daniel




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

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


Received: (at 79862) by debbugs.gnu.org; 28 Nov 2025 07:31:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 28 02:31:12 2025
Received: from localhost ([127.0.0.1]:44218 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vOswi-0000wE-6a
	for submit <at> debbugs.gnu.org; Fri, 28 Nov 2025 02:31:12 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:47974)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vOswg-0000vu-AB
 for 79862 <at> debbugs.gnu.org; Fri, 28 Nov 2025 02:31:11 -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 1vOswa-00052U-6T; Fri, 28 Nov 2025 02:31:04 -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=7LEjSp9v4z//Nk1qhwFpNMXTGbzcwIWRn5C4M+VkKnQ=; b=S997hp6muf3V
 16bDKdS47IF7Fd4xJ7dX2xv3tl/q8UkhrbtFvwdHI9is+hvkZkxLbn/H6r6HGQAr8SVTyRCzm/JPQ
 PzYNDzb3hNbjEA4h1u/nV4hEMcD9INY2oCs7W8TGWMYoVeyJgpu4jLgZr7N62EmUgn5Kukx2k5Z8C
 pTgyV/V83TVuUP24na7SNUu8B9JKBBdG1A5lGcRQNXVwKVDnqi75QaR69RICP+Wu3prHitF9N0T6S
 3ig1GQD9kMqQ6YWZz6yeWqWQXkIc6+L673TycJvA2QX0WydYn0Oyzcifi6PDH43c5RV4Q9vMOi7hh
 /GanNMV8zyAJZF2lUGjyEw==;
Date: Fri, 28 Nov 2025 09:31:01 +0200
Message-Id: <86bjkmaa16.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <874iqfs5wy.fsf@HIDDEN> (message from Juri Linkov on
 Thu, 27 Nov 2025 20:10:21 +0200)
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
 <86fra6h329.fsf@HIDDEN> <87v7j1ilj2.fsf@HIDDEN>
 <86tsyle2de.fsf@HIDDEN> <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
 <87ldjvctos.fsf@HIDDEN>
 <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN>
 <865xaye2ji.fsf@HIDDEN> <874iqfs5wy.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, casouri@HIDDEN, jonas@HIDDEN,
 79862 <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 (---)

> From: Juri Linkov <juri@HIDDEN>
> Cc: Yuan Fu <casouri@HIDDEN>,  jonas@HIDDEN,  dmitry@HIDDEN,
>   79862 <at> debbugs.gnu.org
> Date: Thu, 27 Nov 2025 20:10:21 +0200
> 
> > No, variables defined in C are made defcustom's in cus-start.el.
> 
> Ok, let's make the variable customizable (not sure about
> adding the version since the variable is old):

We don't need to add the version, but I think we should mention in
NEWS that it is now a customizable variable.




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

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


Received: (at 79862) by debbugs.gnu.org; 28 Nov 2025 07:25:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 28 02:25:21 2025
Received: from localhost ([127.0.0.1]:44138 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vOsr3-0000YW-6g
	for submit <at> debbugs.gnu.org; Fri, 28 Nov 2025 02:25:21 -0500
Received: from mout-p-201.mailbox.org ([80.241.56.171]:34696)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vOsr1-0000Td-3b
 for 79862 <at> debbugs.gnu.org; Fri, 28 Nov 2025 02:25:19 -0500
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4dHlF33Rxvz9tWv;
 Fri, 28 Nov 2025 08:25:11 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1764314711;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=WB+hs8C72+tk6YjfKgkQ9f1der4hPF9WutXvFxzGPno=;
 b=iaW9PYhvd6Scr8OEZPAN+iBOShkPerSBOMuLCxkrXuO9Ce7h2SgZt+9sIoHsX2sikbCF2d
 EyFDoT+OsMdSMSIFM0AITNQDiFmrozrpA0YffOeMzp58B3K+0Sbxna2nzknRvdmIa0J2so
 33i8csTNiNwdw0uNmDA4OefNhcf+0sQH+0VEtkOB/t0cPWydetZltZsrim7ZNbUk6c1D+K
 fqg+nggesLErjihUDFNnW+y6YB0NzQuXqbcvwQRScAoyvqLc2Rvgu2uClEivAsxWT5/JkX
 OWu4CF7EEsT+oDWQRi8qTFNcb+gZqJNuTHjrBVbc4yHDkBglXGkyF2n5fBYqtA==
From: Juri Linkov <juri@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <9E8F265F-8B4E-41E5-B62B-8E79C18674F7@HIDDEN>
Organization: LINKOV.NET
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
 <86fra6h329.fsf@HIDDEN> <87v7j1ilj2.fsf@HIDDEN>
 <86tsyle2de.fsf@HIDDEN> <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
 <87ldjvctos.fsf@HIDDEN>
 <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN>
 <865xaye2ji.fsf@HIDDEN> <874iqfs5wy.fsf@HIDDEN>
 <9E8F265F-8B4E-41E5-B62B-8E79C18674F7@HIDDEN>
Date: Fri, 28 Nov 2025 09:24:16 +0200
Message-ID: <87345yy5zz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, jonas@HIDDEN,
 79862 <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: -1.7 (-)

>>>>> Since 'treesit-extra-load-path' is not a customizable option,
>>>>> we can't save it automatically to user's init files
>>>>> (saving even user options automatically is too nasty).
>>>>> 
>>>>> So let's add a new user option e.g. 'treesit-install-grammar-directory',
>>>>> and treat its value as if it's at the beginning of 'treesit-extra-load-path'.
>>>>> Also it will be used as the default location by 'treesit-ensure-installed’.
>>>> 
>>>> We can declare treesit-extra-load-path as a custom option in
>>>> treesit.el. Correct me if I'm wrong but I think that’s a valid thing
>>>> to do?
>>> 
>>> No, variables defined in C are made defcustom's in cus-start.el.
>> 
>> Ok, let's make the variable customizable (not sure about
>> adding the version since the variable is old):
>
> Agree!

So now pushed.  Not sure if this request can be closed,
or more tweaks are necessary.




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

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


Received: (at 79862) by debbugs.gnu.org; 27 Nov 2025 22:07:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 27 17:07:08 2025
Received: from localhost ([127.0.0.1]:38638 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vOk8p-0005A2-UB
	for submit <at> debbugs.gnu.org; Thu, 27 Nov 2025 17:07:08 -0500
Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:47554)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <casouri@HIDDEN>) id 1vOk8l-00059R-32
 for 79862 <at> debbugs.gnu.org; Thu, 27 Nov 2025 17:07:05 -0500
Received: by mail-pl1-x629.google.com with SMTP id
 d9443c01a7336-2980d9b7df5so14690035ad.3
 for <79862 <at> debbugs.gnu.org>; Thu, 27 Nov 2025 14:07:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1764281217; x=1764886017; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=8gCX5mKF26+OEXrLuRFoD3WDE/3D0AKdq5rDEbqWsEg=;
 b=hsI2+Y61bQDlHV3/YGSckuyVuXInuskWq6CR/rKrUb8F5PG8EpoGh6Z4QLVB2Z2riR
 UDFYnKMY2ucMOWIGwyf2Rgll6PSwYP4vNIbHgAykwhDKfsmXXYzDItClwGPdtO+9OWRx
 lOerk5lLmsUFIuTydmo6sM53ndV//Oc3llenjSTHYeuvuYrmrWs9XwQPUAcvIXzUs3AD
 fM67DfqCBsyE7DQ+lCyIwU9modjtLlQ/LGCA6gs9ZzKyAro1tAIRuadVSSwhFdQkmh8e
 RVxswjJq16GxRHao5rZ+D6mHtIeJ+vwrZXS54UVoRWLerM4RbOYMWCPvgbNN4xgwAiNr
 8KSQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1764281217; x=1764886017;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=8gCX5mKF26+OEXrLuRFoD3WDE/3D0AKdq5rDEbqWsEg=;
 b=WR2Hu0C7PwNRWypM6eSGobVnONm0E3k9cRZ9NcUwkwGiVFrsz+RxUisOhj+/ua75YC
 CBJSVLCgQxtsEOXV0VTC0z4aBtq+jdgzttISssnQs+pAW7Z7xC2iKhp3AFIWop+LFi8m
 DrQBpwHCg45j0khKlJBqVWUIb5i4vG/29xVQJt/aMIu8L1AKUlEcNVsdSL2XNS2WeVAb
 asAfNQU0DZy6SDbkNUkLNrH9+bBqgis7s/kBVPAfiJt28GxuzHW7ztHnOcxSCJgheix9
 r3zmGHbnSNFLDY0F8p5l+v+P4Se2rJx7BPKGc1eP39mFIAcKp68w//u6+OhWTdpDakQX
 2EOw==
X-Forwarded-Encrypted: i=1;
 AJvYcCXbD6MUUbB2RnwkGtq0u4MTAZ65yfT2NJuIZnKIVEYDy2DRWWryCHYcs6J7LAN5cgjaWlZ41w==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yx5xCKQ3q9RHzp9K0xjUtgRQfKrGVs916HbLxRRiFC8Tk0eo3za
 DrTp4LAc4VZZRaTLAO5QpdnJEiITctQnX3/VllsdLybqblS45MdEFqPN
X-Gm-Gg: ASbGnct1fT/lKsKZaNiJj5SiQB9wRKRSjzq0KsbaoOFF4JbXwDaDi+ptiZd/tkZl45A
 0Ez5LkBmlvoF+hINr1RU2/osnScr6jk7vfj37/Cs2LcawudotgZ49uGiKR+1DhWsl8a8gNI3A1u
 afooSjvvntuBXVpwOy22nfZqpD5zHXiPnykDQs1KSEG/CiFUyi1wltb+5L4bVKjlyJ1ATwYJDBy
 xXcyIZqDxm/nDvznQhapY7tgcBaT6QRnHtlO7KEx8x6MhPzktlXTTJhIiS3axLVoMum/mS2TC4a
 tDySBpKoAfzdOn3ZtR55iF9LpY2vMKKFlFbVWVfcjj57DMerJ+6i8mCZeD4kiqc9xGzZjkVm6Zl
 13vhlDICC+tJNw4gHwwUaBOFuf+1ezdP4O+/1Gw7H7eDJ/VxbvsgfOfUNj2Spch9dfMcRSa5eNM
 S3r1G5kZ9E78YByLU07prhMgNh/3nVTME1CVVmtuB4F+I7bpKYGTz6Ea+MxIY=
X-Google-Smtp-Source: AGHT+IE8SRSMeCEqTw6mzE9c8jxfxC52YU2YTTvO+9cH0U7zCzrSX1wZaSywScmrIkDkQH0DBMMG6g==
X-Received: by 2002:a05:7022:4293:b0:11b:7f9a:9f00 with SMTP id
 a92af1059eb24-11c9d6128f8mr20702047c88.4.1764281216687; 
 Thu, 27 Nov 2025 14:06:56 -0800 (PST)
Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net.
 [24.4.247.194]) by smtp.gmail.com with ESMTPSA id
 a92af1059eb24-11dcb04a07bsm10279172c88.7.2025.11.27.14.06.55
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 27 Nov 2025 14:06:56 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\))
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <874iqfs5wy.fsf@HIDDEN>
Date: Thu, 27 Nov 2025 14:06:45 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <9E8F265F-8B4E-41E5-B62B-8E79C18674F7@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN> <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN> <86fra6h329.fsf@HIDDEN>
 <87v7j1ilj2.fsf@HIDDEN> <86tsyle2de.fsf@HIDDEN>
 <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
 <87ldjvctos.fsf@HIDDEN>
 <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN> <865xaye2ji.fsf@HIDDEN>
 <874iqfs5wy.fsf@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
X-Mailer: Apple Mail (2.3826.700.81)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, jonas@HIDDEN,
 79862 <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: -1.0 (-)



> On Nov 27, 2025, at 10:10=E2=80=AFAM, Juri Linkov <juri@HIDDEN> =
wrote:
>=20
>>>> Since 'treesit-extra-load-path' is not a customizable option,
>>>> we can't save it automatically to user's init files
>>>> (saving even user options automatically is too nasty).
>>>>=20
>>>> So let's add a new user option e.g. =
'treesit-install-grammar-directory',
>>>> and treat its value as if it's at the beginning of =
'treesit-extra-load-path'.
>>>> Also it will be used as the default location by =
'treesit-ensure-installed=E2=80=99.
>>>=20
>>> We can declare treesit-extra-load-path as a custom option in
>>> treesit.el. Correct me if I'm wrong but I think that=E2=80=99s a =
valid thing
>>> to do?
>>=20
>> No, variables defined in C are made defcustom's in cus-start.el.
>=20
> Ok, let's make the variable customizable (not sure about
> adding the version since the variable is old):

Agree!

Yuan=




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

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


Received: (at 79862) by debbugs.gnu.org; 27 Nov 2025 18:11:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 27 13:11:45 2025
Received: from localhost ([127.0.0.1]:37509 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vOgT3-0006Vp-Ae
	for submit <at> debbugs.gnu.org; Thu, 27 Nov 2025 13:11:45 -0500
Received: from mout-p-201.mailbox.org ([80.241.56.171]:53830)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vOgSz-0006VU-4u
 for 79862 <at> debbugs.gnu.org; Thu, 27 Nov 2025 13:11:42 -0500
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4dHPdK24vbz9scQ;
 Thu, 27 Nov 2025 19:11:33 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1764267093;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=i7b4gWZystHBTA7pVENg1PGG0e4+iq4MGwX+DmmYKLY=;
 b=r5V36O0vYhQlYpg9avboWC36BTO8WUaOd/ymDbfawi4wgRGbA1my2972k6Dwondk3Wj7IJ
 TANLag9fZelvixu8aZ7kACWRsiiZu43xhSCGX1Q4XKUAvrQH6YdT6lyPAQwzhtA6eAdhjg
 6OBdGV1zS8q48kmtGqgZ1hXDtWVbaDx4s8I591qkDqEwc0vmwCZKMTl4qy6rv6p6gwzNC8
 oV8dLk407iAfFSHFrR3GxaRb6kj8H9WYOSNNLmQur42gUG7gy0cWR1th1AHbi9o5eCsXks
 3uloy3HKc3hOjEkhrYoifR/UDfwCHqIKpCyi7fjacFcxD81r49VfhdclJfu5zw==
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <865xaye2ji.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
 <86fra6h329.fsf@HIDDEN> <87v7j1ilj2.fsf@HIDDEN>
 <86tsyle2de.fsf@HIDDEN> <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
 <87ldjvctos.fsf@HIDDEN>
 <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN>
 <865xaye2ji.fsf@HIDDEN>
Date: Thu, 27 Nov 2025 20:10:21 +0200
Message-ID: <874iqfs5wy.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, Yuan Fu <casouri@HIDDEN>, jonas@HIDDEN,
 79862 <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: -1.7 (-)

>> > Since 'treesit-extra-load-path' is not a customizable option,
>> > we can't save it automatically to user's init files
>> > (saving even user options automatically is too nasty).
>> > 
>> > So let's add a new user option e.g. 'treesit-install-grammar-directory',
>> > and treat its value as if it's at the beginning of 'treesit-extra-load-path'.
>> > Also it will be used as the default location by 'treesit-ensure-installed’.
>> 
>> We can declare treesit-extra-load-path as a custom option in
>> treesit.el. Correct me if I'm wrong but I think that’s a valid thing
>> to do?
>
> No, variables defined in C are made defcustom's in cus-start.el.

Ok, let's make the variable customizable (not sure about
adding the version since the variable is old):

diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 19ac478e21a..b59decbc1a9 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -621,6 +621,9 @@ minibuffer-prompt-properties--setter
                (const :tag "Default" nil)
                (const :tag "Silent" ignore)
                function))
+             ;; treesit.c
+             (treesit-extra-load-path
+              treesit (repeat (directory :format "%v")))
 	     ;; undo.c
 	     (undo-limit undo integer "27.1")
 	     (undo-strong-limit undo integer "27.1")




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:31:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:31:51 2025
Received: from localhost ([127.0.0.1]:42314 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzhW-0004pD-6s
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:31:51 -0500
Received: from mail.hostpark.net ([212.243.197.30]:45520)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <jonas@HIDDEN>) id 1vMyqF-00066r-2T
 for 79862 <at> debbugs.gnu.org; Sat, 22 Nov 2025 20:24:40 -0500
Received: from localhost (localhost [127.0.0.1])
 by mail.hostpark.net (Postfix) with ESMTP id 3F3061614C;
 Sun, 23 Nov 2025 02:24:35 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h=
 content-transfer-encoding:content-type:content-type:mime-version
 :message-id:date:date:references:in-reply-to:subject:subject
 :from:from; s=sel2011a; t=1763861074; bh=WY7r59NNfBQgdILTLFmc5G/
 4wQjV0HyVP45ew9NR/Mw=; b=FPOTERTUNQw8aeCNx8UBgB7tmEiGboyDKrfDsO4
 Uq8/ZAoYXzMWuz/4y3puiNCTI44HBRPHQoxIIk9nJv+BbMBgJlPrs5/0c6LbgIs+
 vDXP7eYLwuG6Y6BICtgsOdOGJeWiqxGf0JCNI3r7ZAo38/lFF4uTcZucJBjNOSWP
 N/I0=
X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net
Received: from mail.hostpark.net ([127.0.0.1])
 by localhost (mail1.hostpark.net [127.0.0.1]) (amavis, port 10224) with ESMTP
 id 0E32pH0olxaf; Sun, 23 Nov 2025 02:24:34 +0100 (CET)
Received: from customer (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange secp256r1 server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by mail.hostpark.net (Postfix) with ESMTPSA id D349416148;
 Sun, 23 Nov 2025 02:24:33 +0100 (CET)
From: Jonas Bernoulli <jonas@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>, Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
Date: Sun, 23 Nov 2025 02:24:31 +0100
Message-ID: <87y0nxilrk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: Eli Zaretskii <eliz@HIDDEN>, 79862 <at> debbugs.gnu.org,
 Juri Linkov <juri@HIDDEN>
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: -1.7 (-)

Yuan Fu <casouri@HIDDEN> writes:

>> On Nov 21, 2025, at 4:17=E2=80=AFAM, Dmitry Gutov <dmitry@HIDDEN> wro=
te:
>>=20
>> On 21/11/2025 09:18, Juri Linkov wrote:
>>> We could add a new choice to 'treesit-auto-install-grammar'
>>> that will ask where to install the grammar like Yuan proposed:
>>=20
>> If Jonas just wants to avoid treesit, the question of where to
>> install grammars could still be a distraction.
>
> I think the idea is to control where treesit-auto-install-grammar
> installs grammars to, not just avoid tree-sitter. If someone wants to
> disable auto-install, they just set treesit-auto-install-grammar. I do
> agree that my proposal might be distracting. So perhaps a variable to
> control where to install the grammar is needed.

Yes, I don't mind tree-sitter at all.  It's just that don't usually work
with languages that have tree-sitter grammers.  If tree-sitter makes
Docker files better great, then I would like to use that.  I also do not
mind that a grammar is installed automatically.  I was only bothered by
it showing up in a place I would like to avoid.

> I don=E2=80=99t think we should guess from treesit-extra-load-path. That=
=E2=80=99s not
> the purpose of treesit-extra-load-path. For me, extra-load-path is a
> lower level concept.
>
> How about this: we don=E2=80=99t ask user for where to install the grammar
> interactively. Those who want to use their own place needs to set a
> variable themselves. In the doctoring of that variable, we make it
> clear that the user needs to add the directory to
> treesit-extra-load-path as well.

That would work for me.




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:29:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:29:42 2025
Received: from localhost ([127.0.0.1]:42196 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzfR-00029s-R9
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:29:42 -0500
Received: from eggs.gnu.org ([209.51.188.92]:55370)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vNs23-0003EY-UZ
 for 79862 <at> debbugs.gnu.org; Tue, 25 Nov 2025 07:20:34 -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 1vNrsB-0004zO-Im; Tue, 25 Nov 2025 07:10:19 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=T/DpuTacuVP0nawhlOkbE0qM38FkeW0rwwPWoPba/4c=; b=KtrNJiHq1zAb3+m4C+ax
 raH4mRkWPTvqQ8wAo/2oez+qxxbMeWVUCyZ4XtVnkplnFieQpsAl5wcXf7f2nEIYe0+75wIKKlLSb
 FXUBZOJszWVdQcHMhBo340Jku3oWTlOxHRPpX6PgHcPnWsYRDcgk8noc6BrcGoFZTmZDNmyZAbDwS
 VNlXEu4d63IzhvXJpYBhVG3Pjhw+7K4oBmb9okj0ZBrvTAC2r6+avR0niIlUeMllafDhS0+wuodWb
 rRM6uMsXkPKPo14ePWv92p+WXH7uKxDZH5IxMpZfV9DHNa54ryVc/GAE4EvpHPpWr0YzUi/OB+UvD
 3ei+TYEj/9A0rQ==;
Date: Tue, 25 Nov 2025 14:10:09 +0200
Message-Id: <865xaye2ji.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN> (message from
 Yuan Fu on Mon, 24 Nov 2025 20:07:01 -0800)
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN> <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN> <86fra6h329.fsf@HIDDEN>
 <87v7j1ilj2.fsf@HIDDEN> <86tsyle2de.fsf@HIDDEN>
 <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
 <87ldjvctos.fsf@HIDDEN>
 <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, jonas@HIDDEN, 79862 <at> debbugs.gnu.org, juri@HIDDEN
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: -1.0 (-)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Mon, 24 Nov 2025 20:07:01 -0800
> Cc: Eli Zaretskii <eliz@HIDDEN>,
>  Jonas Bernoulli <jonas@HIDDEN>,
>  dmitry@HIDDEN,
>  79862 <at> debbugs.gnu.org
> 
> 
> 
> > On Nov 24, 2025, at 9:25 AM, Juri Linkov <juri@HIDDEN> wrote:
> > 
> >>> But I still think that a separate option would be much better
> >>> because it doesn't require adding manually to the init file:
> >>> (add-to-list 'treesit-extra-load-path "/out-dir")
> >> 
> >> LGTM. But if user picks a path not in the extra-load-path, next time they
> >> start Emacs, will they be shown the same prompt to install grammar? (Since
> >> we don’t add the path to extra-load-path for them.) For this case, can we
> >> show an extra prompt to save the path to extra-load-path with custom if
> >> user agrees?
> > 
> > Since 'treesit-extra-load-path' is not a customizable option,
> > we can't save it automatically to user's init files
> > (saving even user options automatically is too nasty).
> > 
> > So let's add a new user option e.g. 'treesit-install-grammar-directory',
> > and treat its value as if it's at the beginning of 'treesit-extra-load-path'.
> > Also it will be used as the default location by 'treesit-ensure-installed’.
> 
> We can declare treesit-extra-load-path as a custom option in treesit.el. Correct me if I'm wrong but I think that’s a valid thing to do?

No, variables defined in C are made defcustom's in cus-start.el.




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:29:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:29:41 2025
Received: from localhost ([127.0.0.1]:42193 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzfR-00029p-By
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:29:41 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:34710)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vNrsI-00026f-LY
 for 79862 <at> debbugs.gnu.org; Tue, 25 Nov 2025 07:10:41 -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 1vNrsB-0004zO-Im; Tue, 25 Nov 2025 07:10:19 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=T/DpuTacuVP0nawhlOkbE0qM38FkeW0rwwPWoPba/4c=; b=KtrNJiHq1zAb3+m4C+ax
 raH4mRkWPTvqQ8wAo/2oez+qxxbMeWVUCyZ4XtVnkplnFieQpsAl5wcXf7f2nEIYe0+75wIKKlLSb
 FXUBZOJszWVdQcHMhBo340Jku3oWTlOxHRPpX6PgHcPnWsYRDcgk8noc6BrcGoFZTmZDNmyZAbDwS
 VNlXEu4d63IzhvXJpYBhVG3Pjhw+7K4oBmb9okj0ZBrvTAC2r6+avR0niIlUeMllafDhS0+wuodWb
 rRM6uMsXkPKPo14ePWv92p+WXH7uKxDZH5IxMpZfV9DHNa54ryVc/GAE4EvpHPpWr0YzUi/OB+UvD
 3ei+TYEj/9A0rQ==;
Date: Tue, 25 Nov 2025 14:10:09 +0200
Message-Id: <865xaye2ji.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN> (message from
 Yuan Fu on Mon, 24 Nov 2025 20:07:01 -0800)
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN> <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN> <86fra6h329.fsf@HIDDEN>
 <87v7j1ilj2.fsf@HIDDEN> <86tsyle2de.fsf@HIDDEN>
 <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
 <87ldjvctos.fsf@HIDDEN>
 <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, jonas@HIDDEN, 79862 <at> debbugs.gnu.org, juri@HIDDEN
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 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Mon, 24 Nov 2025 20:07:01 -0800
> Cc: Eli Zaretskii <eliz@HIDDEN>,
>  Jonas Bernoulli <jonas@HIDDEN>,
>  dmitry@HIDDEN,
>  79862 <at> debbugs.gnu.org
> 
> 
> 
> > On Nov 24, 2025, at 9:25 AM, Juri Linkov <juri@HIDDEN> wrote:
> > 
> >>> But I still think that a separate option would be much better
> >>> because it doesn't require adding manually to the init file:
> >>> (add-to-list 'treesit-extra-load-path "/out-dir")
> >> 
> >> LGTM. But if user picks a path not in the extra-load-path, next time they
> >> start Emacs, will they be shown the same prompt to install grammar? (Since
> >> we don’t add the path to extra-load-path for them.) For this case, can we
> >> show an extra prompt to save the path to extra-load-path with custom if
> >> user agrees?
> > 
> > Since 'treesit-extra-load-path' is not a customizable option,
> > we can't save it automatically to user's init files
> > (saving even user options automatically is too nasty).
> > 
> > So let's add a new user option e.g. 'treesit-install-grammar-directory',
> > and treat its value as if it's at the beginning of 'treesit-extra-load-path'.
> > Also it will be used as the default location by 'treesit-ensure-installed’.
> 
> We can declare treesit-extra-load-path as a custom option in treesit.el. Correct me if I'm wrong but I think that’s a valid thing to do?

No, variables defined in C are made defcustom's in cus-start.el.




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:29:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:29:23 2025
Received: from localhost ([127.0.0.1]:42172 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzf7-00026i-Ns
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:29:23 -0500
Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:50611)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <casouri@HIDDEN>) id 1vNkKl-00013E-Uw
 for 79862 <at> debbugs.gnu.org; Mon, 24 Nov 2025 23:07:21 -0500
Received: by mail-pg1-x530.google.com with SMTP id
 41be03b00d2f7-b98983baeacso2435528a12.1
 for <79862 <at> debbugs.gnu.org>; Mon, 24 Nov 2025 20:07:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1764043633; x=1764648433; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=hLfXRK7YxTER5BHLAy6J9pbQW1Lyhm8bdm0FCvW6iJM=;
 b=eesHBLXajiz3h0Nh9cCByJqOiHe4lpwZT4pHSRmfNzC1tybz5FSQCXq+6sSoUZyrLP
 0xIe1P0BrDfVduP9P54ZJiRAO8mD4axE5Li0oe+hBGcakxuf9RuFJWPq2H9fXf/beCFW
 mHe+gx6c1sVGbSsaJGuLRFbKes1Xbo6GpIDS7Te6PtfvABiW0xBXA0HZg0WI7mUmLkqP
 zszIpR+nHlus2q0RDYc49NFElbbXFuflR0QIihCtBHTGBHt7gl1AUqBQU5fH7RSSvY4e
 HzZ4dSG9mITCErLLA+nDq0O7k3vEz8ed5DH9GaJJ8Si3jB4qSkNVbNlfDUalrchgie1W
 ky1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1764043633; x=1764648433;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=hLfXRK7YxTER5BHLAy6J9pbQW1Lyhm8bdm0FCvW6iJM=;
 b=p4VIWOKfg/g79YwD9YnIGPKHhaKyLD3K1nBwLvsbFh6oXN5e7MVPAGcy0aGMMPrYwh
 rr7lwvscYBsjxvecucixgcgTCzU4OyfMVUc+0mkZfNrpkrGfpSdnfol5NEiXo+elu5xi
 sJLjOukyApCKqd1pWfzaePmNgzu376ERIFM6fM+2E1MEJaAR4bHSHreBMOTMhA4uiRRO
 VtBZHGE5oY3nOD8DLRMHnKg53x/0rHEIyr2NC/000aQ88UdhVyewgJdjgzFfycA87ZR+
 mJE9U9dXomMwM3lc/uc1drNBwSbqna4aXvofJjUAR6olWD6l6P4/sw3BY1g6IknSh6xw
 lm3Q==
X-Forwarded-Encrypted: i=1;
 AJvYcCWBdOKV1q5xJDP4YpYcQ9RFP1dWczIlH1Hpw+9lv9mWrGtXYlN0/7KM9rwFkzzKPVRK6xkzbg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyKSD0dR4AEhB6vMeA4oEriu4hfxfW9NoEYCmPImafMbsy/geVk
 CcMH8zh4MTxcym02qZdcoHMHyz6Y1Nt3u8BFVO7+NxBsDoivxal+n+MA
X-Gm-Gg: ASbGncvxaK37MBXqBi9UI14fOpudzUoR0ihWSIedVe6pd2PuXIZk9JctDYvdgORM25A
 pRfBVHKjqWVHCqfEx8eBiUwucmcSIu38YAbW8xw/D8c1GaKSJ+uvZSNs4zIvjRTg9um0HKNghBT
 RHv0XF8yIr6TiIMuG74qMP0evfoMa/aQDSaOdSxNIE9yvR5iUi5gqcoFvkq26bqiB+3BIvI4GX/
 GqHrfBCpiLGqcUXarNvZY12N4axsKb5fVe0V2Y5YE33n4SqOQ6cHe/En6ZlV7LjZmpGwTH/eL2L
 BAZvk5JCbfzmDO+ma+vcYanVmbeQL4fcyzmQRoTzVunK7Vom/VXvi4lEJNSgiGpollQc5JXDNoO
 N13vFSNaMZH/YRMcXvFAcBt5E+G8EXE/2WaPVqzxzh7wseCNBKPL+l2inhohBxw6NX31PT6jqIG
 4Er+K6vtpfP2RGd4sx3d50DZhZI/9yBYyaLeWcIc0cF92KEvVDwQj4HuNw8Ug=
X-Google-Smtp-Source: AGHT+IH+MUJY2HW8VZjxyfyovyrilvPblOGAcp9Z1kFK8io9psIKxPV3P16MkB7bfqS4RkRBB5Mbxw==
X-Received: by 2002:a05:7022:f691:b0:11b:94ab:be03 with SMTP id
 a92af1059eb24-11c9d811fbemr8021884c88.20.1764043633318; 
 Mon, 24 Nov 2025 20:07:13 -0800 (PST)
Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net.
 [24.4.247.194]) by smtp.gmail.com with ESMTPSA id
 a92af1059eb24-11c93e5674csm77108493c88.8.2025.11.24.20.07.12
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 24 Nov 2025 20:07:12 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\))
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <87ldjvctos.fsf@HIDDEN>
Date: Mon, 24 Nov 2025 20:07:01 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <A1EC752D-4D3F-4660-B770-FCAAD818AE2F@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN> <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN> <86fra6h329.fsf@HIDDEN>
 <87v7j1ilj2.fsf@HIDDEN> <86tsyle2de.fsf@HIDDEN>
 <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
 <87ldjvctos.fsf@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
X-Mailer: Apple Mail (2.3826.700.81)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Jonas Bernoulli <jonas@HIDDEN>, 79862 <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: -1.0 (-)



> On Nov 24, 2025, at 9:25=E2=80=AFAM, Juri Linkov <juri@HIDDEN> =
wrote:
>=20
>>> But I still think that a separate option would be much better
>>> because it doesn't require adding manually to the init file:
>>> (add-to-list 'treesit-extra-load-path "/out-dir")
>>=20
>> LGTM. But if user picks a path not in the extra-load-path, next time =
they
>> start Emacs, will they be shown the same prompt to install grammar? =
(Since
>> we don=E2=80=99t add the path to extra-load-path for them.) For this =
case, can we
>> show an extra prompt to save the path to extra-load-path with custom =
if
>> user agrees?
>=20
> Since 'treesit-extra-load-path' is not a customizable option,
> we can't save it automatically to user's init files
> (saving even user options automatically is too nasty).
>=20
> So let's add a new user option e.g. =
'treesit-install-grammar-directory',
> and treat its value as if it's at the beginning of =
'treesit-extra-load-path'.
> Also it will be used as the default location by =
'treesit-ensure-installed=E2=80=99.

We can declare treesit-extra-load-path as a custom option in treesit.el. =
Correct me if I'm wrong but I think that=E2=80=99s a valid thing to do?

Yuan=




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:27:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:27:37 2025
Received: from localhost ([127.0.0.1]:42096 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzdQ-0001qI-SL
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:27:37 -0500
Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202]:40890)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vNafo-0004SY-DJ
 for 79862 <at> debbugs.gnu.org; Mon, 24 Nov 2025 12:48:26 -0500
Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4dFYFr62P6z9tGQ;
 Mon, 24 Nov 2025 18:48:16 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1764006496;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=v8fTBdZU6XruN6Si9WD8ACxP4CNMQ07BEzKESjR6sAU=;
 b=t4lu1Q3ZmwwaNjsQ8eB1rCymI9C8uHUL3jrI/Mn8f9g7VE2/PRyVQqtZ41kd2l+DS9lgL0
 zzYNN3D1ZmHJuf0srju+0WYoGkjlrflJ+Txz5GDuHEUe8j5Xf9Y0gjpg5WP96oUlfXARBN
 iowRLtIO4Md0Xcqb7xk8MVNpDIXzAtb/YbGuig9ZBjieO6o3XsVT0EyN9kf20hRN0D1w7b
 4cwLqeS+Vhjw3logI747BQZfRBtKfyHesE1mYdYHhMHotp+Wjwr8EMJ2kBBXeSSdd8s0BD
 PY7MOKsG2E+A9liRIA76DiwS3ZgIiTeLWU0LdXJ6qF0zSHvhNcXOwCeHv33HHg==
From: Juri Linkov <juri@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
Organization: LINKOV.NET
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
 <86fra6h329.fsf@HIDDEN> <87v7j1ilj2.fsf@HIDDEN>
 <86tsyle2de.fsf@HIDDEN> <877bvhp51i.fsf@HIDDEN>
 <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
Date: Mon, 24 Nov 2025 19:25:27 +0200
Message-ID: <87ldjvctos.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Jonas Bernoulli <jonas@HIDDEN>, 79862 <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: -1.7 (-)

>> But I still think that a separate option would be much better
>> because it doesn't require adding manually to the init file:
>> (add-to-list 'treesit-extra-load-path "/out-dir")
>
> LGTM. But if user picks a path not in the extra-load-path, next time they
> start Emacs, will they be shown the same prompt to install grammar? (Since
> we don’t add the path to extra-load-path for them.) For this case, can we
> show an extra prompt to save the path to extra-load-path with custom if
> user agrees?

Since 'treesit-extra-load-path' is not a customizable option,
we can't save it automatically to user's init files
(saving even user options automatically is too nasty).

So let's add a new user option e.g. 'treesit-install-grammar-directory',
and treat its value as if it's at the beginning of 'treesit-extra-load-path'.
Also it will be used as the default location by 'treesit-ensure-installed'.




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:23:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:23:05 2025
Received: from localhost ([127.0.0.1]:41958 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzZ2-0001Fo-9x
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:23:05 -0500
Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:53443)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <casouri@HIDDEN>) id 1vNGvt-0003gB-9d
 for 79862 <at> debbugs.gnu.org; Sun, 23 Nov 2025 15:43:42 -0500
Received: by mail-pf1-x42f.google.com with SMTP id
 d2e1a72fcca58-7b89c1ce9easo4198505b3a.2
 for <79862 <at> debbugs.gnu.org>; Sun, 23 Nov 2025 12:43:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1763930615; x=1764535415; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=ZnCjgW/B1OSBkLa/icsftG7A9ht0md9IwS89bETPZ4o=;
 b=WxUerAkEbVxZ+3wfUeprWNmx8S5USA5A6pbKQbO8idOBjRo0EJ3RwfO2R3M8u0wH+7
 7Fx5EUkkD2TOfsGaZsAAr0ry0YKAGUW2KXC58DV+VpZLt16qK3VQuza9iLustWOI/WIE
 o5XuGgYuxrnAkdB0NnTQs7JorQw+ai8tIdcyoIUeSpWmgl+AsxIfxBkVk0Kwe5w2tHBJ
 pVeZQO9e25uJJwLHhVNRINJuDiX2GE9llVjsIBTxZIL2ng8Or0J6YYA+S21gvXE8L42i
 SZc51W57JIpCrXqdV7mxEFnavSVzIzhFsL67iYcuUr3Xpv3WFJ/hI61PVlUPTddT5yJd
 oyKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1763930615; x=1764535415;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=ZnCjgW/B1OSBkLa/icsftG7A9ht0md9IwS89bETPZ4o=;
 b=DTCteJ1s4omZajSC8xuojm43gWfPysy/bx8mKNVOlIMxfQa3/U5SGJgpBxzdDz2m9l
 6FPWzW7x4o2h9BHS6NcmdiLvOkTs5pUyvy7V8wmNv2NMuvPz7ingrWhxf7qsv9nzonQd
 8jPrhvnnI6K00WYL+eMP5q9rtVPxQTawytQtBFbcSBuq0BgteRJhtSq3E5RfLwsP3JLM
 Z4MBzFn9t8u0N7o2yYzZsSP2z6BVcC6854A/pgIzcVfbdHpvwFJVAssgPConfknlRQBI
 Mc6N0AvyoON49SRauD14EgT0ONX6a3u8PkCn3xLt2TETmmsRLaCNSwL04t6I3QfcHWaB
 1gQQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVEwaLjnIFeRRe3c+dOCJ7ROy8gCYmAnY0z/dvdIrv+U5JNegihGEGSbj/GjsK1yjEU3NSscQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxCAwB6dvJb66pHnkQoiXk7NVJTp2YW1T1Rh8EfP6vy7SvVsZ4x
 KMya0VUYnenA6H4xhv41XxCLgnfmeKgPnvQhg8OPG0Dyghfk+DgbtsDTRS3LUQ==
X-Gm-Gg: ASbGncvtvGMla0gJRnIAtxPsrVOpoSPlPl8leIzsY5/+h/mboBoVsoV1Oko1wgx0CRD
 JEe3afsvnMCpzya4ZqgE8gFUrSlddAupcASfn5gEfekA82k6IQPhhY62WAzJnNJqp1bGfQATRCz
 KzC+UjRDhQYLKoqYJLrAmk7amKvjiVubm0of+qTebPnkJzXBGtRiSjVXJF3zv+HvcjOYdAdUc/C
 lA4fBBAuRNjxVI3/3hR44x7mb4/xSzuNourtBn3WAEUsZUmgNuHYyFaiEKiFilOGahL0j4npwvy
 uvYanbMxTgQdfBGElMQiT8LC2wiC2cl6TESsDyx5S1eRGKhnnEoCwSovEnWVaikpDIjiY39r34f
 1P2eN5JDcDrWhpkPHgLiUZpY6ujSGO8NrLxQ6Mq3y6fR8u4OMURgi7i65Brv9c+ih+4UvBQLWub
 Vkq4KxCygUrZDlTZpbZUuNc11fw4Cx+9fsbmiw3KM8862gfuP3o2NvcafA+ZJVtqaXe/j4lA==
X-Google-Smtp-Source: AGHT+IGV7mTCxfOR0eGDQJdFDykembcrTRC8QE1jgPFX59RWrEKPE3I7Qpl2TrKcK6YoJ7Y8HNbolA==
X-Received: by 2002:a05:7022:629f:b0:11b:9386:a3bf with SMTP id
 a92af1059eb24-11c9d87286fmr7306512c88.42.1763930614840; 
 Sun, 23 Nov 2025 12:43:34 -0800 (PST)
Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net.
 [24.4.247.194]) by smtp.gmail.com with ESMTPSA id
 a92af1059eb24-11c93db556csm60045313c88.1.2025.11.23.12.43.34
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 23 Nov 2025 12:43:34 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\))
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <877bvhp51i.fsf@HIDDEN>
Date: Sun, 23 Nov 2025 12:43:23 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <36A79C8B-6F96-4119-93CE-5BA410383B2C@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN> <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN> <86fra6h329.fsf@HIDDEN>
 <87v7j1ilj2.fsf@HIDDEN> <86tsyle2de.fsf@HIDDEN>
 <877bvhp51i.fsf@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
X-Mailer: Apple Mail (2.3826.700.81)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Jonas Bernoulli <jonas@HIDDEN>, 79862 <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: -1.0 (-)



> On Nov 22, 2025, at 11:43=E2=80=AFPM, Juri Linkov <juri@HIDDEN> =
wrote:
>=20
>> Under my suggestion, Emacs will pick up the first _writable_ =
directory
>> in treesit-extra-load-path.  If none of them are writable by the =
user,
>> the grammar library will end up under user-emacs-directory, as it is
>> today.
>>=20
>> The advantage is that no additional customization by the user is
>> needed.
>>=20
>> But if you-all still prefer a separate directory and a prompt, I =
won't
>> argue anymore.
>=20
> Here is the patch that picks up the first writable directory.
>=20
> But I still think that a separate option would be much better
> because it doesn't require adding manually to the init file:
> (add-to-list 'treesit-extra-load-path "/out-dir")
>=20
> diff --git a/src/treesit.c b/src/treesit.c
> index 3230d0a50a1..d3b6f36ec81 100644
> --- a/src/treesit.c
> +++ b/src/treesit.c
> @@ -5273,7 +5273,9 @@ syms_of_treesit (void)
> When trying to load a tree-sitter language definition,
> Emacs first looks in the directories mentioned in this variable,
> then in the `tree-sitter' subdirectory of `user-emacs-directory', and
> -then in the system default locations for dynamic libraries, in that =
order.  */);
> +then in the system default locations for dynamic libraries, in that =
order.
> +The first writeable directory in the list is special: it's used as =
the
> +default directory when automatically installing the language grammar. =
 */);
>   Vtreesit_extra_load_path =3D Qnil;
>=20
>   DEFVAR_LISP ("treesit-thing-settings",
> diff --git a/lisp/treesit.el b/lisp/treesit.el
> index e365fc218dd..b5cb01d03d3 100644
> --- a/lisp/treesit.el
> +++ b/lisp/treesit.el
> @@ -5461,8 +5461,12 @@ treesit-auto-install-grammar
>   "Whether to install tree-sitter language grammar libraries when =
needed.
> This controls whether Emacs will install missing grammar libraries
> when they are needed by some tree-sitter based mode.
> -If `ask', ask for confirmation before installing the required grammar =
library.
> If `always', install the grammar library without asking.
> +If `ask', ask for confirmation before installing the required grammar =
library.
> +If `ask-dir', ask for confirmation and also for a directory name =
where
> +to install the grammar library.  The directory name is also asked =
when
> +the value is `ask' and `treesit-extra-load-path' is customized to a =
list
> +of directories.
> If nil or `never' or anything else, don't install the grammar library
> even while visiting a file in the mode that requires such grammar; =
this
> might display a warning and/or fail to turn on the mode."
> @@ -5470,7 +5474,9 @@ treesit-auto-install-grammar
>                  (const :tag "Always automatically install grammar =
libraries"
>                         always)
>                  (const :tag "Ask whether to install missing grammar =
libraries"
> -                        ask))
> +                        ask)
> +                 (const :tag "Ask where to install missing grammar =
libraries"
> +                        ask-dir))
>   :version "31.1")
>=20
> (defun treesit-ensure-installed (lang)
> @@ -5479,14 +5485,28 @@ treesit-ensure-installed
> the grammar library if it's unavailable."
>   (when (treesit-available-p)
>     (or (treesit-ready-p lang t)
> -        (when (or (eq treesit-auto-install-grammar 'always)
> -                  (and (eq treesit-auto-install-grammar 'ask)
> -                       (y-or-n-p (format "\
> -Tree-sitter grammar for `%s' is missing; install it?"
> -                                         lang))))
> -          (treesit-install-language-grammar lang)
> -          ;; Check that the grammar was installed successfully
> -          (treesit-ready-p lang)))))
> +        (let (out-dir)
> +          (when (or (eq treesit-auto-install-grammar 'always)
> +                    (and (memq treesit-auto-install-grammar '(ask =
ask-dir))
> +                         (y-or-n-p (format "\
> +Tree-sitter grammar for `%s' is missing; install it?" lang))
> +                         (or (and (eq treesit-auto-install-grammar =
'ask)
> +                                  ;; Still ask dir for customized =
path
> +                                  (null treesit-extra-load-path))
> +                             (let ((default-out-dir
> +                                    (or (seq-find #'file-writable-p
> +                                                  =
treesit-extra-load-path)
> +                                        (locate-user-emacs-file =
"tree-sitter"))))
> +                               (setq out-dir (read-directory-name
> +                                              (format-prompt "\
> +Install grammar for `%s' to" nil lang)
> +                                              default-out-dir
> +                                              treesit-extra-load-path =
t))
> +                               (add-to-list 'treesit-extra-load-path =
out-dir)
> +                               t))))
> +            (treesit-install-language-grammar lang out-dir)
> +            ;; Check that the grammar was installed successfully
> +            (treesit-ready-p lang))))))
>=20
> ;;; Treesit enabled modes

LGTM. But if user picks a path not in the extra-load-path, next time =
they start Emacs, will they be shown the same prompt to install grammar? =
(Since we don=E2=80=99t add the path to extra-load-path for them.) For =
this case, can we show an extra prompt to save the path to =
extra-load-path with custom if user agrees?

Yuan






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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:22:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:22:17 2025
Received: from localhost ([127.0.0.1]:41876 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzYF-00013d-VZ
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:22:17 -0500
Received: from mout-p-103.mailbox.org ([2001:67c:2050:0:465::103]:46950)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vN4oG-00051t-Fu
 for 79862 <at> debbugs.gnu.org; Sun, 23 Nov 2025 02:47:01 -0500
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4dDgyL59MTz9sWm;
 Sun, 23 Nov 2025 08:46:50 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1763884010;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=FVEwOEX8opQ2yTWlKdGKWdppJgGRzBmY0jTEnWY2QyA=;
 b=ZxuQxMuy1E3ISVeqVeM3bSUqeAC0oKUoi7acsdLYpafypAF6Lll/f95tINbohWYTOcANQQ
 A3ObtV0nRkFIKeD2g8wCMRvIgU44f0WrlVVL8IzXIPSb6MpM70uFnFXsyZA9xTVIGbs0Yg
 mDcYo7RHxXgFrbkuiVaT/T1umq2bpHmgeAf1a3vUUEfskNrE43akCdmEc59tso1QITEeTc
 jsW07gM78wuFGYrJbzvz0HE6JkHiabq9hQL9DtU4XLeqtBxWF0iDSXQl8TQKgGm+ij8f+r
 W2sDomAyH+yYeEimtV/OGujOxlBhOBpuBUVmMeQX7BAcveMt1cDt920iFiCRAg==
Authentication-Results: outgoing_mbo_mout; dkim=none;
 spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates
 2001:67c:2050:b231:465::102 as permitted sender)
 smtp.mailfrom=juri@HIDDEN
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <86tsyle2de.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
 <86fra6h329.fsf@HIDDEN> <87v7j1ilj2.fsf@HIDDEN>
 <86tsyle2de.fsf@HIDDEN>
Date: Sun, 23 Nov 2025 09:43:53 +0200
Message-ID: <877bvhp51i.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Rspamd-Queue-Id: 4dDgyL59MTz9sWm
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, casouri@HIDDEN, Jonas Bernoulli <jonas@HIDDEN>,
 79862 <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: -1.7 (-)

--=-=-=
Content-Type: text/plain

> Under my suggestion, Emacs will pick up the first _writable_ directory
> in treesit-extra-load-path.  If none of them are writable by the user,
> the grammar library will end up under user-emacs-directory, as it is
> today.
>
> The advantage is that no additional customization by the user is
> needed.
>
> But if you-all still prefer a separate directory and a prompt, I won't
> argue anymore.

Here is the patch that picks up the first writable directory.

But I still think that a separate option would be much better
because it doesn't require adding manually to the init file:
(add-to-list 'treesit-extra-load-path "/out-dir")


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=treesit-ensure-installed-out-dir.patch

diff --git a/src/treesit.c b/src/treesit.c
index 3230d0a50a1..d3b6f36ec81 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -5273,7 +5273,9 @@ syms_of_treesit (void)
 When trying to load a tree-sitter language definition,
 Emacs first looks in the directories mentioned in this variable,
 then in the `tree-sitter' subdirectory of `user-emacs-directory', and
-then in the system default locations for dynamic libraries, in that order.  */);
+then in the system default locations for dynamic libraries, in that order.
+The first writeable directory in the list is special: it's used as the
+default directory when automatically installing the language grammar.  */);
   Vtreesit_extra_load_path = Qnil;
 
   DEFVAR_LISP ("treesit-thing-settings",
diff --git a/lisp/treesit.el b/lisp/treesit.el
index e365fc218dd..b5cb01d03d3 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -5461,8 +5461,12 @@ treesit-auto-install-grammar
   "Whether to install tree-sitter language grammar libraries when needed.
 This controls whether Emacs will install missing grammar libraries
 when they are needed by some tree-sitter based mode.
-If `ask', ask for confirmation before installing the required grammar library.
 If `always', install the grammar library without asking.
+If `ask', ask for confirmation before installing the required grammar library.
+If `ask-dir', ask for confirmation and also for a directory name where
+to install the grammar library.  The directory name is also asked when
+the value is `ask' and `treesit-extra-load-path' is customized to a list
+of directories.
 If nil or `never' or anything else, don't install the grammar library
 even while visiting a file in the mode that requires such grammar; this
 might display a warning and/or fail to turn on the mode."
@@ -5470,7 +5474,9 @@ treesit-auto-install-grammar
                  (const :tag "Always automatically install grammar libraries"
                         always)
                  (const :tag "Ask whether to install missing grammar libraries"
-                        ask))
+                        ask)
+                 (const :tag "Ask where to install missing grammar libraries"
+                        ask-dir))
   :version "31.1")
 
 (defun treesit-ensure-installed (lang)
@@ -5479,14 +5485,28 @@ treesit-ensure-installed
 the grammar library if it's unavailable."
   (when (treesit-available-p)
     (or (treesit-ready-p lang t)
-        (when (or (eq treesit-auto-install-grammar 'always)
-                  (and (eq treesit-auto-install-grammar 'ask)
-                       (y-or-n-p (format "\
-Tree-sitter grammar for `%s' is missing; install it?"
-                                         lang))))
-          (treesit-install-language-grammar lang)
-          ;; Check that the grammar was installed successfully
-          (treesit-ready-p lang)))))
+        (let (out-dir)
+          (when (or (eq treesit-auto-install-grammar 'always)
+                    (and (memq treesit-auto-install-grammar '(ask ask-dir))
+                         (y-or-n-p (format "\
+Tree-sitter grammar for `%s' is missing; install it?" lang))
+                         (or (and (eq treesit-auto-install-grammar 'ask)
+                                  ;; Still ask dir for customized path
+                                  (null treesit-extra-load-path))
+                             (let ((default-out-dir
+                                    (or (seq-find #'file-writable-p
+                                                  treesit-extra-load-path)
+                                        (locate-user-emacs-file "tree-sitter"))))
+                               (setq out-dir (read-directory-name
+                                              (format-prompt "\
+Install grammar for `%s' to" nil lang)
+                                              default-out-dir
+                                              treesit-extra-load-path t))
+                               (add-to-list 'treesit-extra-load-path out-dir)
+                               t))))
+            (treesit-install-language-grammar lang out-dir)
+            ;; Check that the grammar was installed successfully
+            (treesit-ready-p lang))))))
 
 ;;; Treesit enabled modes
 

--=-=-=--




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:22:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:22:15 2025
Received: from localhost ([127.0.0.1]:41873 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzYF-00013L-55
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:22:15 -0500
Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]:57198)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vN4oC-00051n-WC
 for 79862 <at> debbugs.gnu.org; Sun, 23 Nov 2025 02:46:57 -0500
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4dDgyH39xYz9t74;
 Sun, 23 Nov 2025 08:46:47 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1763884007;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=pRQV6loJr8SmV6oHVhDiI/dY8PQg8ye4wcfuakpzuMc=;
 b=uigq3xPnnOzuDSkeimmvCBNX4XWPemjsRgTDGfmV/JUPKbBqr+voLVHZYDr98kFXXlWykH
 jiNNnMIOwNbhdFhYwjpX2Hss7Fdum1Mw/2KlAxSqGFrC4szqW203c7KbpejB5QrOROmnnx
 kAzVBJX/dztfaDXwVSuV6IDiqhlGLc7pKbATx7M4y2K9mOLyedpVDHwYE6KcRLnCc9o59p
 NcX1zflcVYJBffwmIlGSKnVb0y0PERab8O9wuOLqXbKCTd/Kw90OvviLZA6u9jNweSKF/w
 8DQBug/wXETdQf5FCbCzk6xJwgcgthcUNs8aCqiv9swJ9VQ2gAAwOabAOi6a/g==
Authentication-Results: outgoing_mbo_mout; dkim=none;
 spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates
 2001:67c:2050:b231:465::102 as permitted sender)
 smtp.mailfrom=juri@HIDDEN
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <86jyzjhj7s.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN> <86ldjzhlkg.fsf@HIDDEN>
 <87a50fyg01.fsf@HIDDEN> <86jyzjhj7s.fsf@HIDDEN>
Date: Sun, 23 Nov 2025 09:39:50 +0200
Message-ID: <87ms4dp589.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4dDgyH39xYz9t74
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, casouri@HIDDEN, jonas@HIDDEN,
 79862 <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: -1.7 (-)

>> >> >> My use-case is that I do not actually use treesit and thus do not
>> >> >> want there to be a "tree-sitter" directory sitting in my well curated
>> >> >> "~/.config/emacs".  But I looked at a Dockerfile and that triggered the
>> >> >> creation of "~/.config/emacs/tree-sitter/libtree-sitter-dockerfile.so".
>> >> >
>> >> > Perhaps you'll want to customize 'treesit-auto-install-grammar' to 'never'?
>> >> 
>> >> We could add a new choice to 'treesit-auto-install-grammar'
>> >> that will ask where to install the grammar like Yuan proposed:
>> >
>> > How do we ensure that Emacs will find the library in an arbitrary
>> > directory?
>> 
>> The selected directory will be added to 'treesit-extra-load-path'.
>
> This means rewriting the user's init file, right?  Is this expected by
> users?

Automatically rewriting the user's init file is not the right thing to do.

>> I intended to do this in a separate patch, but this could be added
>> in the same patch after 'add-to-history':
>> 
>>   (add-to-list 'treesit-extra-load-path out-dir)
>
> This will only do for the same session, not for future sessions.

Yes, only for the same session.  For future sessions users still
need to add (add-to-list 'treesit-extra-load-path "/out-dir")
to the init file manually.




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:22:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:22:11 2025
Received: from localhost ([127.0.0.1]:41851 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzYA-00011k-Ff
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:22:11 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:52318)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vN2n6-0006DO-GR
 for 79862 <at> debbugs.gnu.org; Sun, 23 Nov 2025 00:37:41 -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 1vN2mg-0005cH-PB; Sun, 23 Nov 2025 00:37:14 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=eFFwcQfskM6YaPr7dbjHDGuDgeR9iPEr5827Y6yNuig=; b=RXTr6hYy4y4ds3myZQZC
 tS1w/vp68mQcJQ7uiOH02QK1Wy4u4fAaaG+f5UOA/ug+dNrAadIeWiWkDVc3SdPoabq6Xv12iy4QA
 UHI7lcN6c7HikqllYeQYqIbJ8lZyIFJRKlZ6UsyAEwThq1jOn07QuNDTboxN0ciXdaAWUveMcUtm5
 PcgfSTvWVm6KZoIQmLTTlcWAUkeiUybxJxOfUUVfG2Am6PEFhGoZj8Aat7FhM/J4YEAtOB4q/zdAs
 UODSzoUXc8XnIpUrqJdLnFbMBQkPY+cOHLTr/NFjZlMz3NaFNi1mcUl2oJxd9vE+Yw+u8nrBSqRPA
 vxzc2p/aVqdgpg==;
Date: Sun, 23 Nov 2025 07:37:01 +0200
Message-Id: <86tsyle2de.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jonas Bernoulli <jonas@HIDDEN>
In-Reply-To: <87v7j1ilj2.fsf@HIDDEN> (message from Jonas Bernoulli on Sun, 
 23 Nov 2025 02:29:37 +0100)
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN> <86fra6h329.fsf@HIDDEN>
 <87v7j1ilj2.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, casouri@HIDDEN, 79862 <at> debbugs.gnu.org, juri@HIDDEN
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 (---)

> From: Jonas Bernoulli <jonas@HIDDEN>
> Cc: dmitry@HIDDEN, juri@HIDDEN, 79862 <at> debbugs.gnu.org
> Date: Sun, 23 Nov 2025 02:29:37 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> From: Yuan Fu <casouri@HIDDEN>
> >> Date: Fri, 21 Nov 2025 18:07:54 -0800
> >> Cc: Juri Linkov <juri@HIDDEN>,
> >>  Jonas Bernoulli <jonas@HIDDEN>,
> >>  Eli Zaretskii <eliz@HIDDEN>,
> >>  79862 <at> debbugs.gnu.org
> >> 
> >> I don’t think we should guess from treesit-extra-load-path. That’s not the purpose of treesit-extra-load-path. For me, extra-load-path is a lower level concept.
> >
> > Can you explain why you think extra-load-path is a lower-level
> > concept?  To me, this sounds like a first-class user-level feature
> > intended to allow storing the grammar libraries in a place that is
> > neither a fixed subdirectory of user-emacs-directory nor the
> > system-wide directory where shared libraries are kept (which might not
> > be writable by the user).
> >
> >> How about this: we don’t ask user for where to install the grammar interactively. Those who want to use their own place needs to set a variable themselves. In the doctoring of that variable, we make it clear that the user needs to add the directory to treesit-extra-load-path as well.
> >
> > That could also work, but since it relies on users reading the doc
> > string and following its advice, it is IMO less desirable than my
> > suggestion to use treesit-extra-load-path as guidance, because in that
> > case this stuff will "just work".
> 
> Just a slightly educated guess, but I think treesit-extra-load-path,
> until now, was mainly intended for distribution package managers and
> such.  So we cannot assume that the user wants to install in one of
> these directories (which?), they most likely would not have the
> permissions necessary to do that.

Under my suggestion, Emacs will pick up the first _writable_ directory
in treesit-extra-load-path.  If none of them are writable by the user,
the grammar library will end up under user-emacs-directory, as it is
today.

The advantage is that no additional customization by the user is
needed.

But if you-all still prefer a separate directory and a prompt, I won't
argue anymore.




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:22:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:22:05 2025
Received: from localhost ([127.0.0.1]:41830 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzY4-0000zr-HZ
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:22:05 -0500
Received: from mail.hostpark.net ([212.243.197.30]:45522)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <jonas@HIDDEN>) id 1vMyv9-0006aH-Eb
 for 79862 <at> debbugs.gnu.org; Sat, 22 Nov 2025 20:29:44 -0500
Received: from localhost (localhost [127.0.0.1])
 by mail.hostpark.net (Postfix) with ESMTP id 9072D1614C;
 Sun, 23 Nov 2025 02:29:39 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h=
 content-transfer-encoding:content-type:content-type:mime-version
 :message-id:date:date:references:in-reply-to:subject:subject
 :from:from; s=sel2011a; t=1763861379; bh=7I1IZFRK8K9/yrIg+WavFft
 pf+ZHRPgvFPQhh0s1Kjw=; b=l3LfRuI4M3KSrI5WsgCdJVenYZukfEnHiq3Yiir
 IFuviH8MOf4WLpUepsBlGhOLwD1QH3M8Tj78J/tVbgC91r60FP5DLWOmIapumfAk
 aZC420mTGCR3u72oyo5VqTHoctCrU1j7b8q7u/Nf3rYnl3bfO2AaKlDJzVIB/W6J
 lhpU=
X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net
Received: from mail.hostpark.net ([127.0.0.1])
 by localhost (mail1.hostpark.net [127.0.0.1]) (amavis, port 10224) with ESMTP
 id tfxjLzdLQE1s; Sun, 23 Nov 2025 02:29:39 +0100 (CET)
Received: from customer (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange secp256r1 server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by mail.hostpark.net (Postfix) with ESMTPSA id 12B7A16148;
 Sun, 23 Nov 2025 02:29:37 +0100 (CET)
From: Jonas Bernoulli <jonas@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>, Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <86fra6h329.fsf@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN> <86fra6h329.fsf@HIDDEN>
Date: Sun, 23 Nov 2025 02:29:37 +0100
Message-ID: <87v7j1ilj2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, 79862 <at> debbugs.gnu.org, juri@HIDDEN
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: -1.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Yuan Fu <casouri@HIDDEN>
>> Date: Fri, 21 Nov 2025 18:07:54 -0800
>> Cc: Juri Linkov <juri@HIDDEN>,
>>  Jonas Bernoulli <jonas@HIDDEN>,
>>  Eli Zaretskii <eliz@HIDDEN>,
>>  79862 <at> debbugs.gnu.org
>>=20
>> I don=E2=80=99t think we should guess from treesit-extra-load-path. That=
=E2=80=99s not the purpose of treesit-extra-load-path. For me, extra-load-p=
ath is a lower level concept.
>
> Can you explain why you think extra-load-path is a lower-level
> concept?  To me, this sounds like a first-class user-level feature
> intended to allow storing the grammar libraries in a place that is
> neither a fixed subdirectory of user-emacs-directory nor the
> system-wide directory where shared libraries are kept (which might not
> be writable by the user).
>
>> How about this: we don=E2=80=99t ask user for where to install the gramm=
ar interactively. Those who want to use their own place needs to set a vari=
able themselves. In the doctoring of that variable, we make it clear that t=
he user needs to add the directory to treesit-extra-load-path as well.
>
> That could also work, but since it relies on users reading the doc
> string and following its advice, it is IMO less desirable than my
> suggestion to use treesit-extra-load-path as guidance, because in that
> case this stuff will "just work".

Just a slightly educated guess, but I think treesit-extra-load-path,
until now, was mainly intended for distribution package managers and
such.  So we cannot assume that the user wants to install in one of
these directories (which?), they most likely would not have the
permissions necessary to do that.




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:18:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:18:34 2025
Received: from localhost ([127.0.0.1]:41613 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzUA-0000MW-QV
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:18:34 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:54196)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vMjCb-0003Vh-74
 for 79862 <at> debbugs.gnu.org; Sat, 22 Nov 2025 03:42:43 -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 1vMjCB-0005iP-5F; Sat, 22 Nov 2025 03:42:15 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=RIcWsyUQx9iBh65XlCpKEFc0yFMzG2fsgEwsV7TMJmM=; b=OBHQH8pNTgc6qIaD7twO
 ByvGTlhFnUljjkJB/Hbgwrm8QyDxcY2zKIEvYTh8UQlK4LXH4aALsT9/KEFx83s5p3qVbmjIfSc5d
 cl6jxpw7nwzPJBQ1GJyKomRJgF+TlewmDZo9gc2P008HlB9AAaY8MiUIHnyG5XNqlsqSCNW1MGznJ
 UWxodOyLl9Yaznz90x9Y/t5twNTNflUCUvOM4eZpVQAykwNHyBSGWjcgWPUvAB95CHoxJcoAqTab4
 nCuS41mRicHEEBvaNz6Bl2JHi3JqPkbymjrud/uv5kGb50KaCNNMAMgnnAdBJij1OPWqoHYuWhTSa
 J/mtl9gM/kYQdw==;
Date: Sat, 22 Nov 2025 10:41:34 +0200
Message-Id: <86fra6h329.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN> (message from
 Yuan Fu on Fri, 21 Nov 2025 18:07:54 -0800)
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN> <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
 <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, jonas@HIDDEN, 79862 <at> debbugs.gnu.org, juri@HIDDEN
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 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Fri, 21 Nov 2025 18:07:54 -0800
> Cc: Juri Linkov <juri@HIDDEN>,
>  Jonas Bernoulli <jonas@HIDDEN>,
>  Eli Zaretskii <eliz@HIDDEN>,
>  79862 <at> debbugs.gnu.org
> 
> I don’t think we should guess from treesit-extra-load-path. That’s not the purpose of treesit-extra-load-path. For me, extra-load-path is a lower level concept.

Can you explain why you think extra-load-path is a lower-level
concept?  To me, this sounds like a first-class user-level feature
intended to allow storing the grammar libraries in a place that is
neither a fixed subdirectory of user-emacs-directory nor the
system-wide directory where shared libraries are kept (which might not
be writable by the user).

> How about this: we don’t ask user for where to install the grammar interactively. Those who want to use their own place needs to set a variable themselves. In the doctoring of that variable, we make it clear that the user needs to add the directory to treesit-extra-load-path as well.

That could also work, but since it relies on users reading the doc
string and following its advice, it is IMO less desirable than my
suggestion to use treesit-extra-load-path as guidance, because in that
case this stuff will "just work".




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:17:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:17:18 2025
Received: from localhost ([127.0.0.1]:55386 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzTS-0005Hs-EE
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:17:18 -0500
Received: from [202.12.124.147] (port=59953
 helo=fout-b4-smtp.messagingengine.com)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1vMQ4j-0003W5-Ay
 for 79862 <at> debbugs.gnu.org; Fri, 21 Nov 2025 07:17:44 -0500
Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42])
 by mailfout.stl.internal (Postfix) with ESMTP id C7DCD1D001AE;
 Fri, 21 Nov 2025 07:17:05 -0500 (EST)
Received: from phl-mailfrontend-01 ([10.202.2.162])
 by phl-compute-02.internal (MEProxy); Fri, 21 Nov 2025 07:17:05 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm2; t=1763727425;
 x=1763813825; bh=0YZ02RA4D1LivAISLsvS2OdFLG22747JZ0zcgSdIdEw=; b=
 lYmbJUCj08O6vcdFPoCxqSbyEc/KhT3JFnLOHjcM54R8a8IAuF4lswJ5nvhe2dJQ
 gcCTnK9eK8bDeFSB3oPWnCzdxPT/KZ4OFET5dTbs8B2Tp4Xf5yk9SQBtZji241It
 10I26fzuVAyQ5nu4jm8mY8FtDMUWD+Hw8hS8H3pwbNNPStvJFbX1fKdN0fgbrXee
 P9LRVANaeHZt8SvmaTIBRC/m4q3ZdAvDnpxJhfnYReqd8/HlaHkEmsjZNvf3PwUc
 SZcj6nRobXkVPaxHrx4E5HzMmWmN+sR5GtG6HL89f0pZ7zmwCGC5Gw3HkyxKtwZI
 u6C0uwvuTIKWvs9rJoGkOA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1763727425; x=
 1763813825; bh=0YZ02RA4D1LivAISLsvS2OdFLG22747JZ0zcgSdIdEw=; b=T
 PJmKQ0vAclDyAdgHqwNbv/VQ6f9VgjeufRLTFaoSTzJ0OSvEGcf+c/a0NwgyNVnH
 thf9pn2hc75gAwYUMHpbMPALD0C4VvfsdPOUeeXAW39/ZqlE8HSJ6opxeLk+X4dB
 9u2Qw14nPFIjNv4BH6A8emukvk3h2rS0irEFtgcg+vJZ25ix+kUvYqTIBji6Cvg+
 qXKT7vpdgsqLFM4XAaraGLbFnYWFNTKGQB87vkneMdA5kbHxScC1/yAXLqu7xxiV
 65gPNzOpBnRhmTABzE0ljgorBgi0T8DA4KAl/y80WnDRdUYF6za8wC6IX7v8A/c9
 7cQwx2Fv1FR71hskyjLTw==
X-ME-Sender: <xms:QVggaUp8Lu4jYzRFzGOijchjqsiQo1HevQjPO7Cqc1LBxWf_l1WcEA>
 <xme:QVggaRhO2ghDL6oerbJ-KrpD325E5w_QCXpgAruobtZGWl-EsCZMBJnf-Lk9t7kfQ
 Tvf_g_ik8mfLnc1-3fXaadTUO_2HyzaCGnfGPRV28dzPznSQl6ZTjU>
X-ME-Received: <xmr:QVggaRhjT1jj7UpTSnqGiiM5QGAy7qm8Sl2b6Ur2XOQJmISxjJPF2TLF5Y9V439vbg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvvdelleegucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
 rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf
 gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhithhr
 hicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvg
 hrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedujeeh
 necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmih
 htrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhp
 ohhuthdprhgtphhtthhopehjuhhriheslhhinhhkohhvrdhnvghtpdhrtghpthhtohepjh
 honhgrshessggvrhhnohhulhdrlhhipdhrtghpthhtohepvghlihiisehgnhhurdhorhhg
 pdhrtghpthhtoheptggrshhouhhrihesghhmrghilhdrtghomhdprhgtphhtthhopeejle
 ekiedvseguvggssghughhsrdhgnhhurdhorhhg
X-ME-Proxy: <xmx:QVggaXjrlZyefOinirbxrxpzBHG0kKi-bUg3KkQdzi90KtPPqTtBSQ>
 <xmx:QVggaRLPGLXQJvh8o3kZOEJFXlMMeYhuWnm7Lfc-ovxLwazS3ujXEA>
 <xmx:QVggaWGwLuq_DuQWV7HUtFeAdnaQ2qU1DkHtkqhn-Uhcvl_g6G49rQ>
 <xmx:QVggaVSH_bWH7dBQffQ5I8KLc9SLm_OIBfqimHhFev1UBM3_uLZN8A>
 <xmx:QVggaRW2_O0kcn67EM0Ca-RLq70NDoK-9dguJFDIw0oJVmP6JLooCgNa>
Feedback-ID: i07de48aa:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 21 Nov 2025 07:17:03 -0500 (EST)
Message-ID: <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
Date: Fri, 21 Nov 2025 14:17:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
To: Juri Linkov <juri@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN> <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <87a50fzx6n.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On 21/11/2025 09:18, Juri Linkov wrote: > We could add a new
 choice to 'treesit-auto-install-grammar' > that will ask where to install
 the grammar like Yuan proposed: If Jonas just wants to avoid treesit, the
 question of where to install grammars could still be a distraction. 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 T_SPF_HELO_TEMPERROR   SPF: test of HELO record failed (temperror)
 0.0 T_SPF_TEMPERROR        SPF: test of record failed (temperror)
 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
X-Debbugs-Envelope-To: 79862
Cc: Eli Zaretskii <eliz@HIDDEN>, Jonas Bernoulli <jonas@HIDDEN>,
 casouri@HIDDEN, 79862 <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: -0.4 (/)

On 21/11/2025 09:18, Juri Linkov wrote:
> We could add a new choice to 'treesit-auto-install-grammar'
> that will ask where to install the grammar like Yuan proposed:

If Jonas just wants to avoid treesit, the question of where to install 
grammars could still be a distraction.




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

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


Received: (at 79862) by debbugs.gnu.org; 25 Nov 2025 20:17:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:17:13 2025
Received: from localhost ([127.0.0.1]:55374 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzTK-0005GA-J9
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:17:13 -0500
Received: from mail-dy1-x1336.google.com ([2607:f8b0:4864:20::1336]:43033)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <casouri@HIDDEN>) id 1vMd2r-0005LV-Pd
 for 79862 <at> debbugs.gnu.org; Fri, 21 Nov 2025 21:08:29 -0500
Received: by mail-dy1-x1336.google.com with SMTP id
 5a478bee46e88-2a45877bd5eso3767507eec.0
 for <79862 <at> debbugs.gnu.org>; Fri, 21 Nov 2025 18:08:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1763777285; x=1764382085; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=0Fykf1ItI90FFLdPNoENAFQu2Vl8Ctp6hynHXj1bEt0=;
 b=NB3az/CtKKz/WGrY0AeZ9Qn3+G5jPzyOqvTxmZ3JTNVuwtCRY8IOKNmoj7k8s+sbWi
 lCIXUYQdcnA/m/8ASPDjMgZE2j04axJ/K+KD2unOcEZc6y5Gf9OjNS4knqXycS6Zdrqv
 kGvgQ5SGtqfjkZLGEB/YFBrQbxqIMq4laiIdhNn0Z1LWvdgX8YKKtCm/ASuT2PnmhJuY
 Ty52o5TwZbZPYPD1MnHnYe55ZfKdovMk0RUAGUvhYyus9EzWCO/7/ivWbg40f+WDxiaJ
 Er31x9QHyZDLmua4edXsZ1sIbIH9PClhKumZFpMzOMqtmQiD1UAggtoEcp4En3IYjW5o
 HCMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1763777285; x=1764382085;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=0Fykf1ItI90FFLdPNoENAFQu2Vl8Ctp6hynHXj1bEt0=;
 b=sKFnBgM851cz9rW4SWAeB+AZLcpKDr2d2INU5peENX1qZXD/Hfs0nt6ZYXyz5HlXKD
 +X3o7vROPh5W6eRZEW5n+hRFli06LQvi318K9VLaM/eA6MHUPSeiR8Xvt0J206Uu0hua
 LzAtDRRwUIYgBW77PGu/y7UJ66KO8YubOtR36/IwpJS+lPsVHt26HsRB5VXiuzYab4gF
 nT1T5eaNnSc6GNHQzBwGXrDS4b0k/WZIkOq7wm5FosEIm1V2d5/sMYCHVfaEIcf8Qm8x
 dVs8tC6acjosbipxkLVFwbQTVZUCNyxzLfV9+mkKW3txEME9ksNhYGHJfWWRkRY4RHTp
 CSoQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCUSGR8FkZ0zphslWik3rpqfrowlw3PX+BoLN+It3PWLXneXx+x5oqkDbt+jUknzp+ujEaRhMg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxbM82upj5rpG6IGoeRdyjSrtw/ShS/VHTTeoLv3EwNvB9M1Fnt
 t0A/g+JRcTe9+yGn99zvn1k4fcB6/oJS5vhfVYQsSI4Z3NdWuCdHyG2t
X-Gm-Gg: ASbGnculr8E2A/p07UoRDX1MNf2IQ10Nq5C9LXqKQG68xN9P5ac/lApm/AFaA6ucZMB
 SFEG8hzcCVbXOYmlOS5ZKdNOtkkIx7ly3jjrjwkMzuEankRKsFhsbf1wxBOdpKvG9eSu49rYSWD
 JiHQoHoioVt67k6aQbFDv3Fzs75cBZ+savwJ5cKrOIekGGZ1hLw2/akndn35vnmMWeWyIa03JHW
 d7Yr3K4g6pzPCK5hvoi0zGaIcYIeBghQ4uai7aIhr1kJbas6fe+NPMYGoPJKazITC/DdRKOfVym
 dmX0nJiOnJEsnxPEC/NRKcxWpMnvBxTz8pQvZRliiJkOVxsadHr7NM0bMFlvqBZO88Azp9jN6f9
 5tuXmwtNGqAYFIGE/+77Tjxu2FGYk1xCW12Vlu70+bqLBi7Ph2ifg6Ab/mEekhktQ+vmBXdGVXV
 1DBgSaxTIQQna+Y9zh52UnRiW1RMnJGwZqOSDMBPrp1LIey/oWANyCar5pqrI=
X-Google-Smtp-Source: AGHT+IE0hUXXMYJ0U000OIF6AV91YbHLSuFoIR2arFWJw3myK4T1k337bgDsmJNq9O/nZ3zsQXV2Vg==
X-Received: by 2002:a05:7300:f403:b0:2a4:3593:cca7 with SMTP id
 5a478bee46e88-2a6ff530791mr3217689eec.4.1763777285436; 
 Fri, 21 Nov 2025 18:08:05 -0800 (PST)
Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net.
 [24.4.247.194]) by smtp.gmail.com with ESMTPSA id
 a92af1059eb24-11c93e6dbc8sm32367445c88.10.2025.11.21.18.08.04
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 21 Nov 2025 18:08:05 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\))
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
Date: Fri, 21 Nov 2025 18:07:54 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <CEBCA4C5-EE30-49D3-AB17-0B2F61E4C117@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN> <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
 <43440be4-1d2f-4f20-92c2-dc8f25e70922@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
X-Mailer: Apple Mail (2.3826.700.81)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 79862
Cc: 79862 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Jonas Bernoulli <jonas@HIDDEN>, Juri Linkov <juri@HIDDEN>
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: -1.0 (-)



> On Nov 21, 2025, at 4:17=E2=80=AFAM, Dmitry Gutov <dmitry@HIDDEN> =
wrote:
>=20
> On 21/11/2025 09:18, Juri Linkov wrote:
>> We could add a new choice to 'treesit-auto-install-grammar'
>> that will ask where to install the grammar like Yuan proposed:
>=20
> If Jonas just wants to avoid treesit, the question of where to install =
grammars could still be a distraction.

I think the idea is to control where treesit-auto-install-grammar =
installs grammars to, not just avoid tree-sitter. If someone wants to =
disable auto-install, they just set treesit-auto-install-grammar. I do =
agree that my proposal might be distracting. So perhaps a variable to =
control where to install the grammar is needed.

I don=E2=80=99t think we should guess from treesit-extra-load-path. =
That=E2=80=99s not the purpose of treesit-extra-load-path. For me, =
extra-load-path is a lower level concept.

How about this: we don=E2=80=99t ask user for where to install the =
grammar interactively. Those who want to use their own place needs to =
set a variable themselves. In the doctoring of that variable, we make it =
clear that the user needs to add the directory to =
treesit-extra-load-path as well.

Yuan=




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

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


Received: (at 79862) by debbugs.gnu.org; 21 Nov 2025 08:40:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 21 03:40:36 2025
Received: from localhost ([127.0.0.1]:53545 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vMMh1-0002IN-In
	for submit <at> debbugs.gnu.org; Fri, 21 Nov 2025 03:40:36 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:39730)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vMMgy-0002I8-76
 for 79862 <at> debbugs.gnu.org; Fri, 21 Nov 2025 03:40:33 -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 1vMMgr-0001BC-CR; Fri, 21 Nov 2025 03:40:25 -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=4EvgaAhfgUhvvYTHlCh1Az1ZFwJ2jt3oDtrL49z4wLE=; b=owg6IW42Wdrp
 fZjkL+LHcP89mCwZsS8KaAQGlGBATFiLTkx0e7lmGlEZZPrYhLJXQacQfYFjpYpbCSnC0cbAR0Ouu
 TdoMHtDuud/IjMNKRpOgGA0NJ11yIEskiVaBCjaJrfaKlIeWFoQtjvum2KuuRmTZ/NcEExcxEBZvr
 hjesFPSXtDTC0CVpDuJi0zT2XaztEy6Q6+1cLknRQV50ggHa7AnccxmW7U63Tqqeps4NwLqUEqdC3
 ncmH9LspX7TBRjZu670IGOqUF7M3Mh3YOyk5GLiDl2nX2hT5MUrwicd0fxFtDeQTYp2LDDBOF0OOH
 sfzCV398Srq3a9zVQlIaRg==;
Date: Fri, 21 Nov 2025 10:40:23 +0200
Message-Id: <86jyzjhj7s.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87a50fyg01.fsf@HIDDEN> (message from Juri Linkov on
 Fri, 21 Nov 2025 09:57:50 +0200)
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN> <86ldjzhlkg.fsf@HIDDEN>
 <87a50fyg01.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, casouri@HIDDEN, jonas@HIDDEN,
 79862 <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 (---)

> From: Juri Linkov <juri@HIDDEN>
> Cc: dmitry@HIDDEN,  jonas@HIDDEN,  casouri@HIDDEN,
>   79862 <at> debbugs.gnu.org
> Date: Fri, 21 Nov 2025 09:57:50 +0200
> 
> >> >> My use-case is that I do not actually use treesit and thus do not
> >> >> want there to be a "tree-sitter" directory sitting in my well curated
> >> >> "~/.config/emacs".  But I looked at a Dockerfile and that triggered the
> >> >> creation of "~/.config/emacs/tree-sitter/libtree-sitter-dockerfile.so".
> >> >
> >> > Perhaps you'll want to customize 'treesit-auto-install-grammar' to 'never'?
> >> 
> >> We could add a new choice to 'treesit-auto-install-grammar'
> >> that will ask where to install the grammar like Yuan proposed:
> >
> > How do we ensure that Emacs will find the library in an arbitrary
> > directory?
> 
> The selected directory will be added to 'treesit-extra-load-path'.

This means rewriting the user's init file, right?  Is this expected by
users?

> I intended to do this in a separate patch, but this could be added
> in the same patch after 'add-to-history':
> 
>   (add-to-list 'treesit-extra-load-path out-dir)

This will only do for the same session, not for future sessions.




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

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


Received: (at 79862) by debbugs.gnu.org; 21 Nov 2025 07:59:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 21 02:59:34 2025
Received: from localhost ([127.0.0.1]:53333 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vMM3K-0007fz-BA
	for submit <at> debbugs.gnu.org; Fri, 21 Nov 2025 02:59:34 -0500
Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202]:44550)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vMM3I-0007fg-8S
 for 79862 <at> debbugs.gnu.org; Fri, 21 Nov 2025 02:59:32 -0500
Received: from smtp202.mailbox.org (smtp202.mailbox.org
 [IPv6:2001:67c:2050:b231:465::202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4dCSKk4bkPz9tPN;
 Fri, 21 Nov 2025 08:59:22 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1763711962;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=mXsOy+bZ6f20CRAjWFo9KbIbF/Nwo0SawRkOT1vVNE4=;
 b=VID9RajYPHNnQX14N78i5yZbN/z0cad7ogSFRQ8hp+AH5w6YmMEsWJa6WyCGnofU2V2oVw
 8iS5RJ9HmCTHnWq2Tb/NezU9kvdJi0yu8crSJluDlqi6MSnAvHrPLov3oXyLdL0Wvxe/om
 a3hDgQp1zr1l1rI7ZulhoCxenCAE4pIOVHk672Ps8MCO92k6DzMkAjgduzZYXj7t1Tv5Pb
 yFi5X8bGRGDTszvmb5VbH7v37uKSYadanZ7qFmT6meUEYXf37fkY1E3BOvDbEU8C70Zunb
 WRiGjhEZk4pD32qWfgjuHRiB7psUVTzhrOkNdpna5d4HUSPUSF57p5CZcHFjNw==
Authentication-Results: outgoing_mbo_mout; dkim=none;
 spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates
 2001:67c:2050:b231:465::202 as permitted sender)
 smtp.mailfrom=juri@HIDDEN
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <86ldjzhlkg.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN> <86ldjzhlkg.fsf@HIDDEN>
Date: Fri, 21 Nov 2025 09:57:50 +0200
Message-ID: <87a50fyg01.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4dCSKk4bkPz9tPN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, casouri@HIDDEN, jonas@HIDDEN,
 79862 <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: -1.7 (-)

>> >> My use-case is that I do not actually use treesit and thus do not
>> >> want there to be a "tree-sitter" directory sitting in my well curated
>> >> "~/.config/emacs".  But I looked at a Dockerfile and that triggered the
>> >> creation of "~/.config/emacs/tree-sitter/libtree-sitter-dockerfile.so".
>> >
>> > Perhaps you'll want to customize 'treesit-auto-install-grammar' to 'never'?
>> 
>> We could add a new choice to 'treesit-auto-install-grammar'
>> that will ask where to install the grammar like Yuan proposed:
>
> How do we ensure that Emacs will find the library in an arbitrary
> directory?

The selected directory will be added to 'treesit-extra-load-path'.
I intended to do this in a separate patch, but this could be added
in the same patch after 'add-to-history':

  (add-to-list 'treesit-extra-load-path out-dir)

Ok, I will test if this really works in various scenarios.




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

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


Received: (at 79862) by debbugs.gnu.org; 21 Nov 2025 07:49:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 21 02:49:56 2025
Received: from localhost ([127.0.0.1]:53275 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vMLu0-000747-4M
	for submit <at> debbugs.gnu.org; Fri, 21 Nov 2025 02:49:56 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:41888)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vMLtw-00073i-TJ
 for 79862 <at> debbugs.gnu.org; Fri, 21 Nov 2025 02:49:53 -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 1vMLtk-0006tb-B1; Fri, 21 Nov 2025 02:49:44 -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=7uprF+xOL947bPn/ajpfW3JeFmHnZE9p0tlcHikEI5g=; b=fjKvWZCcVD5I
 K9eUqECSFeT5+cI19MRpAxHX1AQBJjhkddCe2frE84+yh8JLN3WFF+7HB/Xu8yG72GKU7GRsxfMxC
 Xp8dbIwRPTRLatPvZ6PVt8gpqElZiPDonheMXgms6D5Rf9TJJhOv0ERAlHRG7JMt1pOBPRKb2LVOy
 9pdpxTkmu0jY80ckMSlqXK/rH4XNcEip3CHQJA0vRYFmmakxv3NWXXl27KM+D55FO093PlKOmbSlu
 kc+eP3ktkj7RbNKs49zpmoxMo6rXh68hYf8dk56KNeT8Vz3xQDFBZeUSWF1RNHRL3kjGhR0g9knqc
 8DN79oppQJ0IY9XOfnCs9A==;
Date: Fri, 21 Nov 2025 09:49:35 +0200
Message-Id: <86ldjzhlkg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87a50fzx6n.fsf@HIDDEN> (message from Juri Linkov on
 Fri, 21 Nov 2025 09:18:20 +0200)
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
 <87a50fzx6n.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79862
Cc: dmitry@HIDDEN, casouri@HIDDEN, jonas@HIDDEN,
 79862 <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 (---)

> From: Juri Linkov <juri@HIDDEN>
> Cc: Jonas Bernoulli <jonas@HIDDEN>,  Eli Zaretskii <eliz@HIDDEN>,
>   casouri@HIDDEN,  79862 <at> debbugs.gnu.org
> Date: Fri, 21 Nov 2025 09:18:20 +0200
> 
> >> My use-case is that I do not actually use treesit and thus do not
> >> want there to be a "tree-sitter" directory sitting in my well curated
> >> "~/.config/emacs".  But I looked at a Dockerfile and that triggered the
> >> creation of "~/.config/emacs/tree-sitter/libtree-sitter-dockerfile.so".
> >
> > Perhaps you'll want to customize 'treesit-auto-install-grammar' to 'never'?
> 
> We could add a new choice to 'treesit-auto-install-grammar'
> that will ask where to install the grammar like Yuan proposed:

How do we ensure that Emacs will find the library in an arbitrary
directory?




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

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


Received: (at 79862) by debbugs.gnu.org; 21 Nov 2025 07:26:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 21 02:26:43 2025
Received: from localhost ([127.0.0.1]:53117 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vMLXW-0004yr-6M
	for submit <at> debbugs.gnu.org; Fri, 21 Nov 2025 02:26:43 -0500
Received: from mout-p-102.mailbox.org ([2001:67c:2050:0:465::102]:35408)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vMLRl-0004Sp-OK
 for 79862 <at> debbugs.gnu.org; Fri, 21 Nov 2025 02:20:46 -0500
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4dCRSy0Mjcz9vGG;
 Fri, 21 Nov 2025 08:20:34 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1763709634;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=L6/MTg0Lc1VqI5RGHLmilCtYOaZBfyDFEoF9xDf+EJs=;
 b=MC56AGx5zQY0yxOoEW5WDMgZF5Z5VQXXvF5YzKBz7seH406LeuGLRlYy898aZQuPdG+4w6
 yRoHc8WMzIK0xoFDRi2AX5LnrZQNaEgQ0l95NfHLYK7lkyk8x/kf9AaXUPDYSWHzJtCtG3
 23OLMtxS1rdauz59ZZUZwi2BfUxSN+KiK5eLMq/Pa2hlURAXcoXhxa3gscT+T+Mh/HKl1N
 sWftYmQiBD8gicos5I7Zn2i4A8anQT3oBQcCptJPsAq3AcBG5Gow6qhSyd/oroOKuO79An
 4hW0hy4pAvGGPtFtaIqqh8BZt9cr0e2hUaXPP6RJ+TCd6O3GthdS8hZzxBidCg==
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
Organization: LINKOV.NET
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
 <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
Date: Fri, 21 Nov 2025 09:18:20 +0200
Message-ID: <87a50fzx6n.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 79862
Cc: Eli Zaretskii <eliz@HIDDEN>, Jonas Bernoulli <jonas@HIDDEN>,
 casouri@HIDDEN, 79862 <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: -1.0 (-)

--=-=-=
Content-Type: text/plain

>> My use-case is that I do not actually use treesit and thus do not
>> want there to be a "tree-sitter" directory sitting in my well curated
>> "~/.config/emacs".  But I looked at a Dockerfile and that triggered the
>> creation of "~/.config/emacs/tree-sitter/libtree-sitter-dockerfile.so".
>
> Perhaps you'll want to customize 'treesit-auto-install-grammar' to 'never'?

We could add a new choice to 'treesit-auto-install-grammar'
that will ask where to install the grammar like Yuan proposed:


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=treesit-ensure-installed-ask-dir.patch

diff --git a/lisp/treesit.el b/lisp/treesit.el
index e365fc218dd..0ce1f8f43f8 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -5470,7 +5470,9 @@ treesit-auto-install-grammar
                  (const :tag "Always automatically install grammar libraries"
                         always)
                  (const :tag "Ask whether to install missing grammar libraries"
-                        ask))
+                        ask)
+                 (const :tag "Ask where to install missing grammar libraries"
+                        ask-dir))
   :version "31.1")
 
 (defun treesit-ensure-installed (lang)
@@ -5479,14 +5481,28 @@ treesit-ensure-installed
 the grammar library if it's unavailable."
   (when (treesit-available-p)
     (or (treesit-ready-p lang t)
-        (when (or (eq treesit-auto-install-grammar 'always)
-                  (and (eq treesit-auto-install-grammar 'ask)
-                       (y-or-n-p (format "\
-Tree-sitter grammar for `%s' is missing; install it?"
-                                         lang))))
-          (treesit-install-language-grammar lang)
-          ;; Check that the grammar was installed successfully
-          (treesit-ready-p lang)))))
+        (let (out-dir)
+          (when (or (eq treesit-auto-install-grammar 'always)
+                    (and (eq treesit-auto-install-grammar 'ask)
+                         (y-or-n-p (format "\
+Tree-sitter grammar for `%s' is missing; install it?" lang)))
+                    (and (eq treesit-auto-install-grammar 'ask-dir)
+                         (y-or-n-p (format "\
+Tree-sitter grammar for `%s' is missing; install it?" lang))
+                         (let ((default-out-dir
+                                (or (car treesit--install-language-grammar-out-dir-history)
+                                    (locate-user-emacs-file "tree-sitter"))))
+                           (setq out-dir (read-directory-name
+                                          (format-prompt "\
+Install tree-sitter grammar for `%s' to: " nil lang)
+                                          default-out-dir default-out-dir t))
+                           (add-to-history
+                            'treesit--install-language-grammar-out-dir-history
+                            out-dir)
+                           out-dir)))
+            (treesit-install-language-grammar lang out-dir)
+            ;; Check that the grammar was installed successfully
+            (treesit-ready-p lang))))))
 
 ;;; Treesit enabled modes
 

--=-=-=--




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

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


Received: (at 79862) by debbugs.gnu.org; 21 Nov 2025 02:49:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 20 21:49:06 2025
Received: from localhost ([127.0.0.1]:51757 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vMHCs-00085R-59
	for submit <at> debbugs.gnu.org; Thu, 20 Nov 2025 21:49:06 -0500
Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]:45343)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1vMHCp-00084f-Q7
 for 79862 <at> debbugs.gnu.org; Thu, 20 Nov 2025 21:49:04 -0500
Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51])
 by mailfhigh.stl.internal (Postfix) with ESMTP id 59AE57A0229;
 Thu, 20 Nov 2025 21:48:58 -0500 (EST)
Received: from phl-mailfrontend-02 ([10.202.2.163])
 by phl-compute-11.internal (MEProxy); Thu, 20 Nov 2025 21:48:58 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm2; t=1763693338;
 x=1763779738; bh=sbChcnDon1NBlawc2J3BFDNRzos+XPgYcSRUXuiaOcU=; b=
 TADo8AbKWQNOUG89PXAmkmpu5w7bagVPvqvTL4767NYj2KyxJVTnHpxWABj9jinb
 uGHwd/niRad233LWJ+9EniiBpe9X1oMTrV3EvCp7p/SN8KEuGk6ENqtYVtDAxFEs
 MR8ta/6Nl27watCM+HA2bmuKEszhy4SIVLg5mp2Za6PawfGHMn8+oiFptbTeOU1z
 qRxbl5rDsgCk20ZYuRhfPLTGocG9tnECnN9CLUZo9dACTE9li41+vZVnDkxW3u0+
 tpqpl3SRw45fDQXq1MTZJd9OQ6a3rNXr/e+sms+CkfJyqj8bkK7YzHTPzdMm8DnP
 nRad74LKMaxR/EC32vO7Sg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1763693338; x=
 1763779738; bh=sbChcnDon1NBlawc2J3BFDNRzos+XPgYcSRUXuiaOcU=; b=P
 RRrpNE7DoHm4UcOlzGoltwA5Mc9gXJMMGsDTEQcgeaih4cAfCD8IxtCd+8mCXwxe
 JTA834uapplerwgPQ+X3j442teiHj7XizSeOGp3ABR5U3eOgSoloFquETTPJ2xp9
 uWseP4ByWRR0/R+FYvYpftZMxkIc/OujVBc46fiqXSUxP6HAewUcxkbcoU+QQBeO
 kkB9XZApnRBuGxG7eKOIjqUYVPwLavkwTmtqCdL2fadNdPxo/TTo2dGM6zE8nGbv
 B2XtJlkgcBxypl6xS/KDyN99RjC727bE7xGcpuVm3CWJ2fUQ3xCHo1cOpqtAlgvR
 43CSqSOOeFkxuteHkmokg==
X-ME-Sender: <xms:GdMfafX2XcTNjtVLKJg-NblHX1wpKNRccy2JzrNTiLWaZIIFxK9Qwg>
 <xme:GdMfaekE7YoTOP3J71_ugX3XG2qNmbGLGV5M19rKZvycpVzuI-GVHA09OWjjhE9Ir
 tY59QFE963MalX_Dv5r1oMq7Z3Xi3QWISDeOvW9oc0HsANmQL7Ee6Q>
X-ME-Received: <xmr:GdMfaQZ7Chy4sykmyrL2zlYsG1IEhNHY6RZq1PGNTES-M6tBkB9N-be6kZ5SlhV8pQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvvdekjeelucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
 rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf
 gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhithhr
 hicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvg
 hrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedujeeh
 necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmih
 htrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhp
 ohhuthdprhgtphhtthhopehjohhnrghssegsvghrnhhouhhlrdhlihdprhgtphhtthhope
 gvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopegtrghsohhurhhisehgmhgrihhlrdgt
 ohhmpdhrtghpthhtohepjeelkeeivdesuggvsggsuhhgshdrghhnuhdrohhrgh
X-ME-Proxy: <xmx:GdMfaZPTpdEAAAl3O8_8lCj7rsOr9vPGMVKg3ZQnl0zCVY_BkBC3wA>
 <xmx:GdMfaVZddnLF3wXhrqxNmGicr2AmqSG2b1869z-rbvTFeFf1epIf1w>
 <xmx:GdMfaX1PHwISmP9QzbFd92vXDb9fU4ofaSu6JXUiXYyHYcPI49lLEQ>
 <xmx:GdMfabc55j0EV1Kncm655E_EUiJKmmELP95F8MrlLDXKx16JFBDr0w>
 <xmx:GtMfaV-3uGt30nq9nRqFGBgP5SzGTo3T9uvteUFN0LbWXTqXwd3OYv8d>
Feedback-ID: i07de48aa:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 20 Nov 2025 21:48:56 -0500 (EST)
Message-ID: <5bc8aa49-83a0-43aa-887a-4b1a52131eb0@HIDDEN>
Date: Fri, 21 Nov 2025 04:48:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
To: Jonas Bernoulli <jonas@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <874iqpwutr.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: casouri@HIDDEN, 79862 <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: -1.7 (-)

On 19/11/2025 23:56, Jonas Bernoulli via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> My use-case is that I do not actually use treesit and thus do not
> want there to be a "tree-sitter" directory sitting in my well curated
> "~/.config/emacs".  But I looked at a Dockerfile and that triggered the
> creation of "~/.config/emacs/tree-sitter/libtree-sitter-dockerfile.so".

Perhaps you'll want to customize 'treesit-auto-install-grammar' to 'never'?




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

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


Received: (at 79862) by debbugs.gnu.org; 20 Nov 2025 07:54:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 20 02:54:55 2025
Received: from localhost ([127.0.0.1]:45120 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLzVH-0006OV-1j
	for submit <at> debbugs.gnu.org; Thu, 20 Nov 2025 02:54:55 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:38840)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vLzVE-0006O8-9R
 for 79862 <at> debbugs.gnu.org; Thu, 20 Nov 2025 02:54:53 -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 1vLzV7-0008AZ-2w; Thu, 20 Nov 2025 02:54:45 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=o3WUnnd6njSzh5Hkof/tAKn4RLt6/2hpjTmD1rPstmA=; b=PRnW7IcpIyWz0tB2dwJT
 rp5DImUQonBi8L9WW6Ufr5u13xgiO1UOqja4z2hDEGrCdZ3d7w9Lj7lVTcnkJEuLAvwmdLMBmkWOe
 SrZ8yy2T3/p5e0tI77rKwK8IsARSdIXbn0OuKomDgyBFA5OaqxQnSQ+I9qc7/Ip0erphUTMm/HQnt
 SXLAAwYbKuBOi1jdmB+CioHVg7VggxylZo822mAg6CNhxED97Lshlr90BWpzhMC6bilaXNzs+dhaq
 aADyx4k2xbTgMfPJ44mVQrUWWEJpZV58Z2/aiVSPtmqGs4A6Id69zn/Hmg8bGC+d7pXxs/skjc3kV
 BQfb1A19VCV9Rg==;
Date: Thu, 20 Nov 2025 09:54:41 +0200
Message-Id: <86fra9i1fi.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <A1C31656-83C5-4270-A7D7-8D4E08E55CD6@HIDDEN> (message from
 Yuan Fu on Wed, 19 Nov 2025 22:42:22 -0800)
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN> <86ms4hi63a.fsf@HIDDEN>
 <A1C31656-83C5-4270-A7D7-8D4E08E55CD6@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79862
Cc: juri@HIDDEN, jonas@HIDDEN, 79862 <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 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Wed, 19 Nov 2025 22:42:22 -0800
> Cc: Jonas Bernoulli <jonas@HIDDEN>,
>  79862 <at> debbugs.gnu.org,
>  Juri Linkov <juri@HIDDEN>
> 
> Instead of trying to guess it, we can prompt the user on where to put the downloaded grammar. (“Should we install the grammar to xxx? Yes/no, and if no, prompt for a directory, and somehow remember that choice and also customize treesit-extra-load-path.) Right now we prompt for a yes/no answer on whether to auto-download and compile the grammar. I can do it but I won’t be able to get to it right now, kinda busy IRL, sorry about that :(

I doubt that asking the user is a good idea in this case.  Users are
not expected to know where treesit.c looks for grammar libraries, so
they are likely to become confused and specify a directory that is not
a good candidate for inclusion in treesit-extra-load-path.  And
modifying the user init files might be a problem on its own, at the
very least not expected by the user.

Why do you think that putting the library in an existing directory
already in treesit-extra-load-path, with tree-sitter subdirectory of
user-emacs-directory as fallback, means "guessing"?  We are using
existing directories configured by the user, and that is IMO a very
good hint as to where we should put it, no?




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

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


Received: (at 79862) by debbugs.gnu.org; 20 Nov 2025 07:12:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 20 02:12:41 2025
Received: from localhost ([127.0.0.1]:44838 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLyqO-0003j7-Uv
	for submit <at> debbugs.gnu.org; Thu, 20 Nov 2025 02:12:41 -0500
Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]:35996)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vLyqM-0003if-0f
 for 79862 <at> debbugs.gnu.org; Thu, 20 Nov 2025 02:12:38 -0500
Received: from smtp202.mailbox.org (smtp202.mailbox.org
 [IPv6:2001:67c:2050:b231:465::202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4dBqL42RMTz9slX;
 Thu, 20 Nov 2025 08:12:28 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1763622748;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=zgUYYJDyc9jt880MtcI/jLi/OiWJM3rv+0x27LN+sEQ=;
 b=IaipfHcbi3zSeof50axl064k1EbaqLXUmxPMU9/xaVZH+VcioeYNz9KzEsCaGOmvQZJR6i
 naL/EayECjAE7p5IYYvAYovh7m+AqomnMpuhPnylbmfwn3hMP430AV7eFZmosjtLx4kUgJ
 PYKumyeFunSpiNaGdUDXYsJuITX26jlCzwYQ1BOS0LW7g7pMLfhGF42/ogSA4LpfCP3w0b
 DSaHL1gtAJrZH1VoItpEZ8k/m6blg//A1hkkhU9tdsvC5WMM58+TU70eHv+pEUThRW4a1O
 8TAEsChOhcNzF7R7siW4zULPFRc1R2nZJG9g2hELorxOoQfO5fPjRSeNyqfHHA==
Authentication-Results: outgoing_mbo_mout; dkim=none;
 spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates
 2001:67c:2050:b231:465::202 as permitted sender)
 smtp.mailfrom=juri@HIDDEN
From: Juri Linkov <juri@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <A1C31656-83C5-4270-A7D7-8D4E08E55CD6@HIDDEN>
Organization: LINKOV.NET
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN> <86ms4hi63a.fsf@HIDDEN>
 <A1C31656-83C5-4270-A7D7-8D4E08E55CD6@HIDDEN>
Date: Thu, 20 Nov 2025 09:10:31 +0200
Message-ID: <873469ji1k.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 4dBqL42RMTz9slX
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: Eli Zaretskii <eliz@HIDDEN>, Jonas Bernoulli <jonas@HIDDEN>,
 79862 <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: -1.7 (-)

> Instead of trying to guess it, we can prompt the user on where to put the
> downloaded grammar. (“Should we install the grammar to xxx? Yes/no, and if
> no, prompt for a directory, and somehow remember that choice and also
> customize treesit-extra-load-path.) Right now we prompt for a yes/no answer
> on whether to auto-download and compile the grammar. I can do it but
> I won’t be able to get to it right now, kinda busy IRL, sorry about that :(

In most cases the users want to install the grammar to the default directory.
Making the prompt much longer and asking extra questions would put burden
on many users unnecessarily.

For rare cases enabling customization of the installation directory
looks like a solid middle ground.




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

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


Received: (at 79862) by debbugs.gnu.org; 20 Nov 2025 06:42:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 20 01:42:44 2025
Received: from localhost ([127.0.0.1]:44663 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLyNP-00021T-Hd
	for submit <at> debbugs.gnu.org; Thu, 20 Nov 2025 01:42:44 -0500
Received: from mail-dl1-x122c.google.com ([2607:f8b0:4864:20::122c]:43043)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <casouri@HIDDEN>) id 1vLyNN-00021A-7Z
 for 79862 <at> debbugs.gnu.org; Thu, 20 Nov 2025 01:42:41 -0500
Received: by mail-dl1-x122c.google.com with SMTP id
 a92af1059eb24-11b6bc976d6so1124018c88.0
 for <79862 <at> debbugs.gnu.org>; Wed, 19 Nov 2025 22:42:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1763620954; x=1764225754; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=XBWavyrNzWEEon/ifcFcCwr1ExlyAqEKXBatoh05R3s=;
 b=b3JQuN5d4IR352CLASk9hcTChV+kkt1DaSeVftwTMac5YwrMnyvNnQV09T05BlSEFx
 Rk4BOlNtVQqn847gLPtYnXlv55CEVRytjnF712Ax3C7NfI1wmj1RFAAwdpHFqz4sEyJF
 xHlh1Nd3rDvY6G9tn42iYpHtHBgK8GKjftxegBd30srL0Qa07t3vPWNJPyIrkcFn5RIZ
 giDfuNQ/VjzienskMhhxJyu8wpcwv57VHnqK0DmyMwPlYSlzNdjjRmbAXdxqBSFYrMRh
 XIUtaAd3lXlDlGTXlgWkM9aMnqo8v5iFBVeCsZYdtf31aieEJ+Uqmny1mBA0/x2HsHGL
 r2lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1763620954; x=1764225754;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=XBWavyrNzWEEon/ifcFcCwr1ExlyAqEKXBatoh05R3s=;
 b=hXqQX9xqqy4ZEqFGvoiu1fmOZwRDCSZvRixjwUImtTjjIWys/eU07IsgDQD9iM0p6X
 mI0tRjwavzxR4kNcP0NxuUVcXYM2NPpzYh1ozANfgtEv/nls6F5KmojDyMMZPbKhfB9B
 y5Kr95jxCZsfDeEu3uPlbGrkCAwvSH6q7wGNgbu7z0V+EvhGfDX97/iDDUyGhX77l60Q
 YhuR5O6QG5pKuNIh8+j0vclQ5gyH/NTS3iafFNBsJX3Lx31XTHFf8o4UbkoBpURYVkp7
 u1uv/ceX4hoLrkDpBsvC6Kl8GNhhzWdr80GogjlcSBaEbBYBjiDAe1uUfTVGugIcAIds
 63PQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCUK+hmMGeYE1Cp8DWBanr3+PeOX/7MDnmistDF4yfKUUNyQwaw6nniJ0Hc5a6IurEwfDGk9KQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzpvxoPS3qlkhil+bBmPr1ygI5PPqciLCW95AgzuJcibkh/eMqp
 6fWtDxeWAQCARpaO1s6eWxtp9x5nIkErlwzW6v6qIfV3O66kGpwldT1+
X-Gm-Gg: ASbGncsPjjtayQ3vsi6LXlED7C8dNKQ1Fdbk5X7Wf8GzE5qdVQx6A8AwpNCQbvPiNlh
 McLgMfRkkNXKGam2djhQ6R/kjtbxwkYCXrGHVMbl9Fy2ebpt2TRTp0PJi0vPHx2o52DwIX5wBwk
 JMoJuXvx5eSSCuEkLTBo/InjzGn4O7GWQIJZeh4HDg/KYDbO3yO2fqBhlA6Al90Whb6HVPtMTRZ
 jsF8szePHirVjhZQ+bVAEKYHNQN9xOYf2yEEmbMtA/+H9SvwM5m2krMOw45m3JdCnfjCQyUhzPk
 n/Ci7WFQvgXnhCKIzV4majD4rjT6dI9mz+KKRUQuubnOZzB37ceQn7biZIVZvWbGuCrsy+zBOdl
 4RuUzQEtCDyJeZa/ygeSZBDNiI17SH37EF1EywY28lPF8EO39sKOpXJFxWLSJLdCxS4gbMmXXr7
 5N7tS3UJGfJOmOkhWsjnvI+hDsr974+5aXrVVkoGMPvFsDpOgCSb33W23SR19lWGJD4wDJgA==
X-Google-Smtp-Source: AGHT+IEiyj3kR0RPAc1+LH9Dx/nv7bra4ZcTyB778BgJkiluDhB4K2YqnRrJtxJvbRKrR15LvGqHSQ==
X-Received: by 2002:a05:7022:522:b0:119:e569:f86c with SMTP id
 a92af1059eb24-11c94b10d94mr420078c88.9.1763620953971; 
 Wed, 19 Nov 2025 22:42:33 -0800 (PST)
Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net.
 [24.4.247.194]) by smtp.gmail.com with ESMTPSA id
 a92af1059eb24-11c93e6da4dsm5535774c88.9.2025.11.19.22.42.33
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 19 Nov 2025 22:42:33 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\))
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <86ms4hi63a.fsf@HIDDEN>
Date: Wed, 19 Nov 2025 22:42:22 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <A1C31656-83C5-4270-A7D7-8D4E08E55CD6@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN> <86ms4hi63a.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3826.700.81)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 79862
Cc: Juri Linkov <juri@HIDDEN>, Jonas Bernoulli <jonas@HIDDEN>,
 79862 <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: -1.0 (-)



> On Nov 19, 2025, at 10:14=E2=80=AFPM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>=20
>> From: Jonas Bernoulli <jonas@HIDDEN>
>> Cc: 79862 <at> debbugs.gnu.org, casouri@HIDDEN
>> Date: Wed, 19 Nov 2025 22:56:00 +0100
>>=20
>> Eli Zaretskii <eliz@HIDDEN> writes:
>>=20
>>> The current code indeed uses a hard-coded directory, but treesit.c
>>> looks in the same directory for grammar libraries.  Adding a =
defcustom
>>> for where to copy the compiled grammar would then require users to
>>> customize treesit-extra-load-path to include that directory, which
>>> will most probably make the confusing and complex setup (as =
witnessed
>>> by the number of questions users ask here and on Reddit) even more
>>> complex.  Is that really a good idea?
>>=20
>> I did not know it was this complicated.
>=20
> Emacs looks for grammar libraries in the directories mentioned in
> treesit-extra-load-path, then in tree-sitter subdirectory of
> user-emacs-directory, then where the system stores shared libraries.
> We could perhaps modify treesit--build-grammar to put the compiled
> library in the first writable directory that is a member of
> treesit-extra-load-path, if that is non-nil, and only if none found,
> put the library under user-emacs-directory.  And maybe provide a user
> option to choose whether to look in treesit-extra-load-path.  Would
> that be better?
>=20
>>> If you have real-life use cases where this seems to be a solution,
>>> please describe those use cases.  Your rationale above says nothing
>>> about that, it just assumes that users will want to control that for
>>> some unexplained reasons.  So it's hard to consider the pros and =
cons
>>> based on that.
>>=20
>> My use-case is that I do not actually use treesit and thus do not
>> want there to be a "tree-sitter" directory sitting in my well curated
>> "~/.config/emacs".  But I looked at a Dockerfile and that triggered =
the
>> creation of =
"~/.config/emacs/tree-sitter/libtree-sitter-dockerfile.so".
>>=20
>> I have now set `treesit-extra-load-path' and moved the module there.
>> Then I visited another Dockerfile and "~/.config/emacs/tree-sitter/"
>> was not re-created, hurrah.  That's workable; I can just move the
>> modules as they appear, and then delete the directory again.
>>=20
>> I would still prefer if no modules were created in a place where I do
>> not want them to appear (and there will be others like me), but =
that's
>> one pro, and I'll let you weight that against the cons.
>=20
> If the above-mentioned change will make the situation better, we could
> make such an improvement, I think.
>=20
> Yuan, any other ideas?

Instead of trying to guess it, we can prompt the user on where to put =
the downloaded grammar. (=E2=80=9CShould we install the grammar to xxx? =
Yes/no, and if no, prompt for a directory, and somehow remember that =
choice and also customize treesit-extra-load-path.) Right now we prompt =
for a yes/no answer on whether to auto-download and compile the grammar. =
I can do it but I won=E2=80=99t be able to get to it right now, kinda =
busy IRL, sorry about that :(

Yuan=




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

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


Received: (at 79862) by debbugs.gnu.org; 20 Nov 2025 06:14:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 20 01:14:17 2025
Received: from localhost ([127.0.0.1]:44483 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLxvs-0000EE-Sg
	for submit <at> debbugs.gnu.org; Thu, 20 Nov 2025 01:14:17 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:38472)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vLxvq-0000E0-2v
 for 79862 <at> debbugs.gnu.org; Thu, 20 Nov 2025 01:14:15 -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 1vLxvk-00082j-54; Thu, 20 Nov 2025 01:14:08 -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=nU4fZ0Ejw7yDypuxW3rBzNRPp1qZtvhyzV5VJJEuvRI=; b=YwGskfGaa1V8
 ne7EBsFky8QHLL8iRMT+inyF5CY1BqlkkVvDt3MouJn+aaNQZLmsvHu2IMCgz8LcJ5hkGooqlr2r3
 0n/0277iPDeyVngIFdQfqnPcR497yZh/zYlCkLDb2Y0MkpscpfpPBOp9+DSd/VAttelReVcfXw7eB
 Kh8mYWwFbm8DKML3y79uwMcRmXnj8B0G9jxLKV7pDYz+MUQKHVrgU4iAoOJYiYagn8dB9Lt7vq1az
 RaDsRhlUVWEu0QAsMGgi/X+/OKHhCMgWSSL21NZOxiHM5SEEqvPhBpIjRvZSgqbV1hGwxdEu9PMQk
 Fp6/43GhyACiDdvcITqGoA==;
Date: Thu, 20 Nov 2025 08:14:01 +0200
Message-Id: <86ms4hi63a.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jonas Bernoulli <jonas@HIDDEN>
In-Reply-To: <874iqpwutr.fsf@HIDDEN> (message from Jonas Bernoulli on Wed, 
 19 Nov 2025 22:56:00 +0100)
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
 <874iqpwutr.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79862
Cc: casouri@HIDDEN, 79862 <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 (---)

> From: Jonas Bernoulli <jonas@HIDDEN>
> Cc: 79862 <at> debbugs.gnu.org, casouri@HIDDEN
> Date: Wed, 19 Nov 2025 22:56:00 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > The current code indeed uses a hard-coded directory, but treesit.c
> > looks in the same directory for grammar libraries.  Adding a defcustom
> > for where to copy the compiled grammar would then require users to
> > customize treesit-extra-load-path to include that directory, which
> > will most probably make the confusing and complex setup (as witnessed
> > by the number of questions users ask here and on Reddit) even more
> > complex.  Is that really a good idea?
> 
> I did not know it was this complicated.

Emacs looks for grammar libraries in the directories mentioned in
treesit-extra-load-path, then in tree-sitter subdirectory of
user-emacs-directory, then where the system stores shared libraries.
We could perhaps modify treesit--build-grammar to put the compiled
library in the first writable directory that is a member of
treesit-extra-load-path, if that is non-nil, and only if none found,
put the library under user-emacs-directory.  And maybe provide a user
option to choose whether to look in treesit-extra-load-path.  Would
that be better?

> > If you have real-life use cases where this seems to be a solution,
> > please describe those use cases.  Your rationale above says nothing
> > about that, it just assumes that users will want to control that for
> > some unexplained reasons.  So it's hard to consider the pros and cons
> > based on that.
> 
> My use-case is that I do not actually use treesit and thus do not
> want there to be a "tree-sitter" directory sitting in my well curated
> "~/.config/emacs".  But I looked at a Dockerfile and that triggered the
> creation of "~/.config/emacs/tree-sitter/libtree-sitter-dockerfile.so".
> 
> I have now set `treesit-extra-load-path' and moved the module there.
> Then I visited another Dockerfile and "~/.config/emacs/tree-sitter/"
> was not re-created, hurrah.  That's workable; I can just move the
> modules as they appear, and then delete the directory again.
> 
> I would still prefer if no modules were created in a place where I do
> not want them to appear (and there will be others like me), but that's
> one pro, and I'll let you weight that against the cons.

If the above-mentioned change will make the situation better, we could
make such an improvement, I think.

Yuan, any other ideas?




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

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


Received: (at 79862) by debbugs.gnu.org; 19 Nov 2025 21:56:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 19 16:56:08 2025
Received: from localhost ([127.0.0.1]:41203 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLq9n-00086u-Ip
	for submit <at> debbugs.gnu.org; Wed, 19 Nov 2025 16:56:07 -0500
Received: from mail.hostpark.net ([212.243.197.30]:45574)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <jonas@HIDDEN>) id 1vLq9k-00086R-Cx
 for 79862 <at> debbugs.gnu.org; Wed, 19 Nov 2025 16:56:06 -0500
Received: from localhost (localhost [127.0.0.1])
 by mail.hostpark.net (Postfix) with ESMTP id 40D1E1635A;
 Wed, 19 Nov 2025 22:56:02 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h=
 content-type:content-type:mime-version:message-id:date:date
 :references:in-reply-to:subject:subject:from:from; s=sel2011a;
 t=1763589361; bh=z+nqt/t14a+fED5KYPdpmuW/FiHUGkTqD8ZFUUCntrg=; b=
 mPAosXviFeY8cf6oSWtWwCZcRACl/beMdihd3sGX/LAwF1L5rmpfKHFiRWgqg2ws
 6FLzMckfjO3ueNunlr1NGHVqrEeLijHme9pJT0236OtnPfBToDsJzuOzBmFT2S81
 uwv6b0lOvxs+oKK4REFXFbg2m9nrWkesBUZ3N+MnOKM=
X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net
Received: from mail.hostpark.net ([127.0.0.1])
 by localhost (mail0.hostpark.net [127.0.0.1]) (amavis, port 10224) with ESMTP
 id aPOjENY46F5l; Wed, 19 Nov 2025 22:56:01 +0100 (CET)
Received: from customer (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange secp256r1 server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by mail.hostpark.net (Postfix) with ESMTPSA id 77DF1162C2;
 Wed, 19 Nov 2025 22:56:01 +0100 (CET)
From: Jonas Bernoulli <jonas@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
In-Reply-To: <86o6oxj1u4.fsf@HIDDEN>
References: <87wm3lnafh.fsf@HIDDEN> <86o6oxj1u4.fsf@HIDDEN>
Date: Wed, 19 Nov 2025 22:56:00 +0100
Message-ID: <874iqpwutr.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79862
Cc: casouri@HIDDEN, 79862 <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: -1.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Date: Wed, 19 Nov 2025 19:29:06 +0100
>> From:  Jonas Bernoulli via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>> 
>> Please add a custom option to customize where treesit installs grammars
>> by default.  Currently this is hard-coded in `treesit--build-grammar'
>> and `treesit-install-language-grammar'.  Interactively the user can
>> choose to use a different directory, which is inconvenient because they
>> have to do it every time, but non-interactively the user does not have
>> any say, the default location is always used.
>
> The current code indeed uses a hard-coded directory, but treesit.c
> looks in the same directory for grammar libraries.  Adding a defcustom
> for where to copy the compiled grammar would then require users to
> customize treesit-extra-load-path to include that directory, which
> will most probably make the confusing and complex setup (as witnessed
> by the number of questions users ask here and on Reddit) even more
> complex.  Is that really a good idea?

I did not know it was this complicated.

> If you have real-life use cases where this seems to be a solution,
> please describe those use cases.  Your rationale above says nothing
> about that, it just assumes that users will want to control that for
> some unexplained reasons.  So it's hard to consider the pros and cons
> based on that.

My use-case is that I do not actually use treesit and thus do not
want there to be a "tree-sitter" directory sitting in my well curated
"~/.config/emacs".  But I looked at a Dockerfile and that triggered the
creation of "~/.config/emacs/tree-sitter/libtree-sitter-dockerfile.so".

I have now set `treesit-extra-load-path' and moved the module there.
Then I visited another Dockerfile and "~/.config/emacs/tree-sitter/"
was not re-created, hurrah.  That's workable; I can just move the
modules as they appear, and then delete the directory again.

I would still prefer if no modules were created in a place where I do
not want them to appear (and there will be others like me), but that's
one pro, and I'll let you weight that against the cons.




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

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


Received: (at 79862) by debbugs.gnu.org; 19 Nov 2025 18:48:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 19 13:48:36 2025
Received: from localhost ([127.0.0.1]:40042 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLnEK-0003OZ-FF
	for submit <at> debbugs.gnu.org; Wed, 19 Nov 2025 13:48:36 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:58876)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vLnEH-0003Nu-26
 for 79862 <at> debbugs.gnu.org; Wed, 19 Nov 2025 13:48:33 -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 1vLnEB-0000Or-8L; Wed, 19 Nov 2025 13:48:27 -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=td1MsRbC0K/D18dKDn5q54X7u1wsMbt/9KRT044W3Lk=; b=ik8fMzmjZPLL
 dBc8ZoNYtzNezw2cyKXPTicWFSsdu3rM5Dql0PVB47B5gveiBgvAZ7utJJP3Weevlw3nXLsrJ+S2p
 UIQQc7cdu2qwLf1eM/vR1bcJPYP/4H+j7qhz8F+CmO9qz6MByqzOff6SE6yTFz/j0vjizLuSJAGYw
 6rqCRmhxXgcnRjH6Nd1dLYbJzxBVnu8WmLoS+jdJuXVIzqdCaZjypUK5eAzhKiPR547AIIU9oZ3zC
 yNZrKcUDcmEfn0pT+iWtqIS9sn8++YW+22PH7++A/VJCuqTTc0aX3sd6JQ6pgLwLMVZk1IibrgNWf
 sZLT27SoAIBZ+DnZLxSNtw==;
Date: Wed, 19 Nov 2025 20:48:19 +0200
Message-Id: <86o6oxj1u4.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jonas Bernoulli <jonas@HIDDEN>
In-Reply-To: <87wm3lnafh.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#79862: Please add option to control where treesit installs
 grammars
References: <87wm3lnafh.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79862
Cc: casouri@HIDDEN, 79862 <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, 19 Nov 2025 19:29:06 +0100
> From:  Jonas Bernoulli via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> Please add a custom option to customize where treesit installs grammars
> by default.  Currently this is hard-coded in `treesit--build-grammar'
> and `treesit-install-language-grammar'.  Interactively the user can
> choose to use a different directory, which is inconvenient because they
> have to do it every time, but non-interactively the user does not have
> any say, the default location is always used.

The current code indeed uses a hard-coded directory, but treesit.c
looks in the same directory for grammar libraries.  Adding a defcustom
for where to copy the compiled grammar would then require users to
customize treesit-extra-load-path to include that directory, which
will most probably make the confusing and complex setup (as witnessed
by the number of questions users ask here and on Reddit) even more
complex.  Is that really a good idea?

If you have real-life use cases where this seems to be a solution,
please describe those use cases.  Your rationale above says nothing
about that, it just assumes that users will want to control that for
some unexplained reasons.  So it's hard to consider the pros and cons
based on that.

Thanks.




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

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


Received: (at submit) by debbugs.gnu.org; 19 Nov 2025 18:29:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 19 13:29:26 2025
Received: from localhost ([127.0.0.1]:39895 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLmvm-00023b-Dw
	for submit <at> debbugs.gnu.org; Wed, 19 Nov 2025 13:29:26 -0500
Received: from lists.gnu.org ([2001:470:142::17]:54606)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <jonas@HIDDEN>) id 1vLmvk-00023M-HV
 for submit <at> debbugs.gnu.org; Wed, 19 Nov 2025 13:29:25 -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 <jonas@HIDDEN>) id 1vLmvd-0003Iq-QB
 for bug-gnu-emacs@HIDDEN; Wed, 19 Nov 2025 13:29:18 -0500
Received: from mail.hostpark.net ([212.243.197.30])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jonas@HIDDEN>) id 1vLmvb-0005ju-Ky
 for bug-gnu-emacs@HIDDEN; Wed, 19 Nov 2025 13:29:17 -0500
Received: from localhost (localhost [127.0.0.1])
 by mail.hostpark.net (Postfix) with ESMTP id 9F3AD162EA;
 Wed, 19 Nov 2025 19:29:09 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h=
 content-type:content-type:mime-version:message-id:date:date
 :subject:subject:from:from; s=sel2011a; t=1763576949; bh=BggrIXn
 P/dUzHPofMxUZ5Nu7A9gjb/3y+kvZEIfmKIg=; b=KM+lRfe4yYYMM3+xxHQwjBS
 /ZJuhLjhyc3Nz72N8cTDIy5cNQGwW0lcJPB54G9Pkq+iDLkE+BeNKqSK0SE6JYHS
 YRbibKxXG/fzklgdpGkaMRymVvarX8e984CqibUa2mbADh/W46CEQja4RsA0ffv9
 4nb8yrOuw8LZoUh2k3cg=
X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net
Received: from mail.hostpark.net ([127.0.0.1])
 by localhost (mail0.hostpark.net [127.0.0.1]) (amavis, port 10224) with ESMTP
 id asRSUP2O_IE7; Wed, 19 Nov 2025 19:29:09 +0100 (CET)
Received: from customer (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange secp256r1 server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by mail.hostpark.net (Postfix) with ESMTPSA id 1E2E2162C2;
 Wed, 19 Nov 2025 19:29:08 +0100 (CET)
From: Jonas Bernoulli <jonas@HIDDEN>
To: bug-gnu-emacs@HIDDEN, Yuan Fu <casouri@HIDDEN>
Subject: Please add option to control where treesit installs grammars
Date: Wed, 19 Nov 2025 19:29:06 +0100
Message-ID: <87wm3lnafh.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=212.243.197.30; envelope-from=jonas@HIDDEN;
 helo=mail.hostpark.net
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
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: -0.1 (/)

Hello,

Please add a custom option to customize where treesit installs grammars
by default.  Currently this is hard-coded in `treesit--build-grammar'
and `treesit-install-language-grammar'.  Interactively the user can
choose to use a different directory, which is inconvenient because they
have to do it every time, but non-interactively the user does not have
any say, the default location is always used.

     Thanks!
     Jonas




Acknowledgement sent to Jonas Bernoulli <jonas@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#79862; 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: Sun, 30 Nov 2025 18:30:01 UTC

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