From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60453: 29.0.60; treesit-range-rules throw an error without tree-sitter Date: Sat, 31 Dec 2022 18:37:55 +0200 Message-ID: <83lemn4jh8.fsf@gnu.org> References: <87wn67sjnw.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30892"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60453@debbugs.gnu.org To: Wilhelm Kirschbaum Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 31 17:38:16 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pBesB-0007t7-Nw for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 31 Dec 2022 17:38:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pBerz-00037K-VR; Sat, 31 Dec 2022 11:38:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBery-00037B-S6 for bug-gnu-emacs@gnu.org; Sat, 31 Dec 2022 11:38:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pBery-0007w7-8a for bug-gnu-emacs@gnu.org; Sat, 31 Dec 2022 11:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pBerx-0007PP-VE for bug-gnu-emacs@gnu.org; Sat, 31 Dec 2022 11:38:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Dec 2022 16:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60453 X-GNU-PR-Package: emacs Original-Received: via spool by 60453-submit@debbugs.gnu.org id=B60453.167250468128472 (code B ref 60453); Sat, 31 Dec 2022 16:38:01 +0000 Original-Received: (at 60453) by debbugs.gnu.org; 31 Dec 2022 16:38:01 +0000 Original-Received: from localhost ([127.0.0.1]:39702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBerw-0007P9-KR for submit@debbugs.gnu.org; Sat, 31 Dec 2022 11:38:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBerv-0007Ox-5K for 60453@debbugs.gnu.org; Sat, 31 Dec 2022 11:37:59 -0500 Original-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 ) id 1pBerp-0007vJ-Uv; Sat, 31 Dec 2022 11:37:53 -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=38D7n6Wwdy21a0CPOhqYXAC1GhgmT0TI7QXqHAekASI=; b=khOwwTbQMBlDfqGZ4ngr 9Tu3+nKrHv69UDwU61p5Jm0JsnToSZc9ZfgbHMyQCvs5o0IwPO3w61uzX3kYD2MnD93UJXX8FpygA LsU7M7OEfP85bZu+SQBka7b9d0yvNj5Ikya7mtpflgl6PjQ63GEpq7fhz+ORBNyDdDb5aNQynCM0Z pVT6N/yD9oObIQK8ulzG2boCxmlLPjDt2TKUG1M97hy+E/SL754CcIqlQ8cJQ9z00CuZyMTmFmNWK owPtfI0yi9exxkO4Koe6TtftaRSc4czJwbUzWJ6NIXXRf/J4LUmGwF6HEKbl6X1354OSxmW0opWlc 3UzW2gmIEHMd8Q==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBerp-0001be-9b; Sat, 31 Dec 2022 11:37:53 -0500 In-Reply-To: <87wn67sjnw.fsf@gmail.com> (message from Wilhelm Kirschbaum on Sat, 31 Dec 2022 16:53:08 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:252203 Archived-At: > From: Wilhelm Kirschbaum > Date: Sat, 31 Dec 2022 16:53:08 +0200 > > > With the following code without tree-sitter library: > > (defvar elixir-ts-mode--treesit-range-rules > (treesit-range-rules > :embed 'heex > :host 'elixir > '((sigil (sigil_name) @name (:match "^[H]$" @name) > (quoted_content) > @heex)))) > > upon loading the mode I get the following error: > > treesit-range-rules: Symbol’s function definition is void: > treesit-query-compile > > This can easily be mitigated with (when (treesit-available-p)...) > but think it should function similar to how (treesit-font-lock-rules > work. Why does it make sense to protect treesit.el's code with treesit-available-p? You aren't supposed to use treesit.el functions when the tree-sitter library is not available. IOW, Lisp programs that want to use treesit-range-rules and other functions from treesit.el should make the treesit-available-p test _before_ that.