From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KGNqMnDI52N7AAAAbAwnHQ (envelope-from ) for ; Sat, 11 Feb 2023 17:55:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QIs5MnDI52OM8QAAauVa8A (envelope-from ) for ; Sat, 11 Feb 2023 17:55:12 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9706211D79 for ; Sat, 11 Feb 2023 17:55:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQt9F-0003dT-9b; Sat, 11 Feb 2023 11:54:49 -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 ) id 1pQt9D-0003d5-3q for guix-devel@gnu.org; Sat, 11 Feb 2023 11:54:47 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQt9A-0007iY-UV for guix-devel@gnu.org; Sat, 11 Feb 2023 11:54:46 -0500 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id A37A720008; Sat, 11 Feb 2023 16:54:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1676134482; 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=Omv6cIQLQl/nuntGfsN/L8gNl8MgRF0LAxe5cRfO0c8=; b=HosYuJdGE/UKvzWqj68h9a/podn4P94Bkdi5uGWcT/vz9CK68NSxEk1jlPzLfPUzB/QHPV HyNYlKz+8ZhpjboZyxBEOvyvbGGdWQe5RS11TTbkJGfkLR6gM0vW0zdZ/pRjijHSY5UtKn 3cwQfDqtMS/J+jblpKvej+yIe04wJuFDR5FdKtXiyTsthtYQCcr2ZSWS2rzXEOcs4QoV8w N/7iJGrC2L6b73hR5ot0NmuVEQjQA08lHMTXAXYKpWyIKA/OuhUaBtT7YJ/Cuo4wv+joFG vtTPr741ffBXvlqTSij0qwZMQp3P+LPiiT6xUnBhXLtMHzrM0CxvGCSG+YiWdQ== From: Andrew Tropin To: Christopher Baines Cc: guix-devel@gnu.org Subject: Re: branch master updated: gnu: emacs: Add TREE_SITTER_GRAMMAR_PATH support. In-Reply-To: <87zg9kgz2i.fsf@trop.in> References: <167610269975.14308.10330520524841229243@vcs2.savannah.gnu.org> <87cz6g5t87.fsf@cbaines.net> <87zg9kgz2i.fsf@trop.in> Date: Sat, 11 Feb 2023 20:54:38 +0400 Message-ID: <874jrsqh0x.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=217.70.183.200; envelope-from=andrew@trop.in; helo=relay7-d.mail.gandi.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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676134512; a=rsa-sha256; cv=none; b=kln1O8HHyODhbmNbS3a0vrybtJuwGd44NurO0iZv1tcRxxUFhD2NHQoeq22WafHBso28Lb eEgFUtjbp3mict0yT0Mz3U5EDpK/oTa7DZuvLQq3S+NeVNZXxK/cB0DgT+GR+biC5eWrRB bR8gzDLg6HX2LAPE1WvzQOV7idK0Owf5ZhS4n6z/FflnW8lx90aO+9IO7xivFMOOZtFjuA qZFTbk1FjV4JHmm8BdmVKTcSERIU+Nx0+OklzMiqK0W2eFmAEjX8AiOWWzSxMZT1P/VUxh DIg51qZu2xM95K8oAqHubbNyZAaM5GD45BYcIvKEnMfwro6Zf65V0LIYwWhcpQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=trop.in header.s=gm1 header.b=HosYuJdG; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676134512; h=from:from:sender:sender: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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Omv6cIQLQl/nuntGfsN/L8gNl8MgRF0LAxe5cRfO0c8=; b=HpCVLI4pdaPakfIkkkSiGH1QbxnpI8X3xZLdgHGr4QrCzRmICQbcc2IgDaDIRuTZO40g5c WaW5rQw0qDP9/2Yv7+PHB7akH9rtSAQ16uGabZ2mG7aQi7YyJu2ZwMwyevBQAFuUlw7Bry bORE94UqMHgxBIajjOMT8L0VbnotQMuIfvbaI9XGj3LPab+2a0vVY/pIpPRF305sbfyTZZ vfgya/9aLMMtEmrVYL937gRvJwPMHEJ4rMyQ3q631Beh5dctuNoerhacM2jA/0c9DrcFlI nl4LdDm1uIJ4scfCUJluEdqsPKgVGHZIuYOt6dtTxuv0JKfLUgvyB5WksiD5JQ== X-Migadu-Spam-Score: -7.74 X-Spam-Score: -7.74 X-Migadu-Queue-Id: 9706211D79 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=trop.in header.s=gm1 header.b=HosYuJdG; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn1.migadu.com X-TUID: PxZLX8exmMup --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2023-02-11 16:35, Andrew Tropin wrote: > On 2023-02-11 11:29, Christopher Baines wrote: > >> guix-commits@gnu.org writes: >> >>> This is an automated email from the git hooks/post-receive script. >>> >>> abcdw pushed a commit to branch master >>> in repository guix. >>> >>> The following commit(s) were added to refs/heads/master by this push: >>> new c77a3d4554 gnu: emacs: Add TREE_SITTER_GRAMMAR_PATH support. >>> c77a3d4554 is described below >>> >>> commit c77a3d4554175ee5320ccc713aa21b1ba3e6b8a3 >>> Author: Andrew Tropin >>> AuthorDate: Fri Feb 10 12:32:12 2023 +0400 >>> >>> gnu: emacs: Add TREE_SITTER_GRAMMAR_PATH support. >>>=20=20=20=20=20 >>> gnu/packages/emacs.scm (emacs)[native-search-paths]: Add a search-p= ath for >>> tree-sitter grammars. >>> gnu/packages/aux-files/emacs/guix-emacs.el: Add directories from >>> TREE_SITTER_GRAMMAR_PATH to treesit-extra-load-path. >>> --- >>> gnu/packages/aux-files/emacs/guix-emacs.el | 7 +++++++ >>> gnu/packages/emacs.scm | 10 +++++++++- >>> 2 files changed, 16 insertions(+), 1 deletion(-) >>> >>> diff --git a/gnu/packages/aux-files/emacs/guix-emacs.el b/gnu/packages/= aux-files/emacs/guix-emacs.el >>> index 56dbcb8d67..708093267d 100644 >>> --- a/gnu/packages/aux-files/emacs/guix-emacs.el >>> +++ b/gnu/packages/aux-files/emacs/guix-emacs.el >>> @@ -76,6 +76,13 @@ The files in the list do not have extensions (.el, .= elc)." >>> (when (file-directory-p pkg-dir) >>> (package-load-descriptor pkg-dir))))))))))) >>>=20=20 >>> +;; If emacs built with tree-sitter, read the value of the environment = variable >>> +;; to make tree-sitter grammars available in emacs out-of-the-box. >>> +(with-eval-after-load 'treesit >>> + (when-let ((grammar-path (getenv "TREE_SITTER_GRAMMAR_PATH"))) >>> + (mapcar (lambda (x) (add-to-list 'treesit-extra-load-path x)) >>> + (split-string grammar-path ":")))) >>> + >>> (provide 'guix-emacs) >>>=20=20 >>> ;;; guix-emacs.el ends here >>> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm >>> index 4ce41deb88..b6a66bafac 100644 >>> --- a/gnu/packages/emacs.scm >>> +++ b/gnu/packages/emacs.scm >>> @@ -367,7 +367,15 @@ >>> (files '("lib/emacs/native-site-lisp"))) >>> (search-path-specification >>> (variable "INFOPATH") >>> - (files '("share/info"))))) >>> + (files '("share/info"))) >>> + ;; tree-sitter support is not yet available in emacs 28, bu= t this >>> + ;; search path won't harm and also will be beneficial for >>> + ;; emacs-next and other emacs-* packages, which have tree-s= itter >>> + ;; support enabled. Please, remove this comment, when emacs >>> + ;; package is updated to 29. >>> + (search-path-specification >>> + (variable "TREE_SITTER_GRAMMAR_PATH") >>> + (files '("lib/tree-sitter"))))) >>>=20=20 >>> (home-page "https://www.gnu.org/software/emacs/") >>> (synopsis "The extensible, customizable, self-documenting text edi= tor") >> >> The change to guix-emacs.el is pretty impactful here since that affects >> all the emacs packages including emacs-minimal I think. >> >> If I've understood your comment correctly, that does seem pretty >> wasteful since those rebuilds because of the changed emacs-minimal won't >> have any affect since it's version 28 and not 29, right? I think >> applying this change to just emacs-next would have been possible. > > It could be applied to emacs-next only and we could move it to emacs > later when it updated to 29, but I checked guix refresh --list-dependent > emacs and it shown less than 100 packages so I decided to apply it > straight to emacs, but I forgot that emacs-minimal is inherited from > emacs and I guess you are right and it will affect all the emacs > packages. Anything we would like to do about it right now? Let's keep it as it is and I'll store it in mind for the next time. There is an idea to update guix refresh --list-dependent to handle the case with inherited packages as well. WDYT? =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmPnyE4ACgkQIgjSCVjB 3rAd4w/+P4JVsTruRHhpqxXdgyzmQejJrOucA78Me0tND8RYSIqzfUBl9Tt7B70u P9j+WBaG2M/HgjCt5chfQhJBNqzGpqHixCJM56TacQgOrT/VIKj+04eb50vTR8yY +EvgA7uRLyvjNNhLt59+vhIu/D+IzntsyOr+IzpaSSCBOEsqVleFrYuTDlWFdYnp aYJQM9enFzSuAuSVnBFTUCLR1H/mtMzNejtP8RiF0Z53IS4D+sf4Olbv+kzyFzZm 4tveJFCks8CqVI7JX249SS75Y9hUC0qq2CBjhY3v3lzkr7d5d8QIcXaW7/+2wd0V KLuNq3PfyKVfZmpczYQDo2RLD18gzIW9wpK3ux22pI9lW9nQqCBCCE0qjULHVmcY wR5ooTL8+L+PHn0YOUA5HhrhgESlrvRX97GuGuDkZd93jyO7w0BGVwn4MZubZOxW 9au2BivYKsckMKSgqOUP64S/P7FWsA5Mxacf6cJh8biRItThjNuRVQrmowTjkWxF mre+RnUnFp0ZrLiykpiQLivDVed1S5aqA2rAiecMD9pRU+70yuAcqypej99uTaxB iZUxQMsQX3poa8pnvHajqG7HdBQvQmco+pdJI6+YfBxggxxEYIad0KeC3lgziuyQ R7kFPKA9OwW1L9Zb0tHpvdYAjk3FQ+xBzYy8TjCQ7+xpVQP+z50= =08nc -----END PGP SIGNATURE----- --=-=-=--