From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: vp Newsgroups: gmane.emacs.devel Subject: Re: Clarification about treesit-font-lock-settings Date: Mon, 27 Feb 2023 12:06:19 +0100 Message-ID: <2825155.mvXUDI8C0e@3-191.divsi.unimi.it> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21678"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 27 12:07:25 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pWbLp-0005Ro-Ds for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Feb 2023 12:07:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWbLO-0003KV-S7; Mon, 27 Feb 2023 06:06:58 -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 1pWbKq-0000pO-1s for emacs-devel@gnu.org; Mon, 27 Feb 2023 06:06:27 -0500 Original-Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWbKo-0008Lb-Bn for emacs-devel@gnu.org; Mon, 27 Feb 2023 06:06:23 -0500 Original-Received: by mail-ed1-x536.google.com with SMTP id eg37so23954044edb.12 for ; Mon, 27 Feb 2023 03:06:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ilg2Gsyq+edJEM29et8zZYsv/xGXNHV3UohRdlULYj4=; b=DsU4x7S6S+vyMUPvmYQImYeB8H33KXMx3yxoMOa28ALQ0N5N3kVIvt2zAmVs0Cr2A1 KEgKw4w4c/oTdSq4PmmfiAKBBMTEA219IpAj9t2QW/NkpvXRRNy3uxLE1m7mCIAr+QcN fVej5lo+VeYXCTHPNTItAgcB8vb8ckQmyWTqyW1TwjIHcru1g/kOVt6nbDje8FlX6mSm B/X11aYx+RbeZOyGcITEO3F5tkT08fqWxMhi+hzoy5SBn1mX7HfGJXSt47Ykval2+u2w vTw/2O6WzbwxYqr5DsuMPuWW78UHlWR/pGWsy8QFGboPlbtHcLsIw2GBNsGhfM50oaHZ JYdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ilg2Gsyq+edJEM29et8zZYsv/xGXNHV3UohRdlULYj4=; b=293RTd3oxpUpJvCFEAwmm/TbjBucbdbnPLs5xuVWwYCxIkndZ+OwA+dGI4P9ayLSN3 eyMvovnJ6RTpNPnJbRohxaNsMFz3hX0mc0PvxKFD0rTEfKVRMSjouZQU7DIAruHjlfHo QhoO3P8um9ESbQnphaWihDnzAZWWd4VnQC5KJfjRbcUx4iv3I7keuemBgfJ5Roh+0Uu1 uFZ+m66UwKWeUr1yYaZAQkklBKS7VxOuSJsKX2fytxkt19NQJBO3MvQ1GSUatxc9W3LK vrQfJjy2o9brziVL4R+h/cAY36MAMaDdwrZyKCGHpSj0pgv3WDr2VLSjWylhArVSBSdb n/zQ== X-Gm-Message-State: AO0yUKVgDPBnPK2h+2oL1I+WSULZ/p7PELftonahCjuRSR2HefOM15DX A9Zui7aeBPJZFRgokJFcnD8= X-Google-Smtp-Source: AK7set8X1ipVDFiVCn+azkH8CXUlzRiMlx6YrfJvEX01vxq7vXbh0uJEYs4Cp04VdAYK6gTq0n51Ag== X-Received: by 2002:a17:906:1c17:b0:8b1:88aa:46da with SMTP id k23-20020a1709061c1700b008b188aa46damr32874563ejg.48.1677495980234; Mon, 27 Feb 2023 03:06:20 -0800 (PST) Original-Received: from 3-191.divsi.unimi.it (3-191.divsi.unimi.it. [159.149.3.191]) by smtp.gmail.com with ESMTPSA id u27-20020a50d51b000000b004af5001c7ecsm2917529edi.12.2023.02.27.03.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:06:19 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=v.pupillo@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 27 Feb 2023 06:06:56 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303829 Archived-At: Thank you Yuan! Vincenzo In data domenica 26 febbraio 2023 10:15:41 CET, Yuan Fu ha scritto: >=20 > > On Feb 25, 2023, at 2:18 PM, Vincenzo Pupillo wro= te: > >=20 > > Okay, I figured out how to do it: > > :language 'php > > :feature 'attribute > > '((((attribute (_) @attribute_name) @font-lock-preprocessor-face) (:= match "Deprecated" @attribute_name))) > >=20 > > However, I cannot understand why "treesit-query-validate" says the quer= y is correct, but I get an error. > >=20 > > Thank you. > > Vincenzo >=20 > Sorry that I missed your message! treesit-query-validate simply compiles = the query and rely on tree-sitter to report any potential error. But predic= ates like #match and #equal are delegated to Emacs to handle, so tree-sitte= r doesn=E2=80=99t check for their arity and there is no error during compil= ation. Also, the error message should say =E2=80=9C#match=E2=80=9D instead = of =E2=80=9C#equal=E2=80=9D, I fixed that typo. >=20 > Yuan >=20