From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] treesit.el: New function to describe font-lock rules Date: Fri, 20 Oct 2023 21:11:01 -0700 Message-ID: References: <46a990f4-0cc1-43cb-b017-38e205e05777@gmail.com> <43D13B5A-A267-4181-893E-506D955E973E@gmail.com> <1e5cd9da-7be2-486d-bbbb-7b50167e2916@gmail.com> <35F71E15-AEAB-45FD-ACF3-50133A1766D8@gmail.com> <2c196077-a1c7-4bfa-91b6-209ebf21b6fa@gmail.com> <91640cdb-d78a-4bd5-895c-9aacca3d4c97@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_5BE25764-9B84-4DA1-9C58-9F5AA5CC4718" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4751"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel , Eli Zaretskii To: Huan Nguyen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 21 06:12:17 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 1qu3LU-00018u-RL for ged-emacs-devel@m.gmane-mx.org; Sat, 21 Oct 2023 06:12:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qu3Kb-0005N4-BC; Sat, 21 Oct 2023 00:11:21 -0400 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 1qu3KZ-0005Mr-Jd for emacs-devel@gnu.org; Sat, 21 Oct 2023 00:11:19 -0400 Original-Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qu3KY-0001iL-7n; Sat, 21 Oct 2023 00:11:19 -0400 Original-Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1ea45b07c59so1115381fac.0; Fri, 20 Oct 2023 21:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697861476; x=1698466276; darn=gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=BNlwpXUkbxUVcz+pkcqjWSLAYAlLV5zJTHIqaZH0PvI=; b=MeXKbCIegUk2bRXaM7hZ8sJ8/6ZMmpIUq0vs4HFqLyAeDpCMdIlBI39uSDnwuaMqtK Zh2kinIeJOoKNR2UZSJ+2Q+krg537b825PNx+8abX4iITTtQ2KwnrWwGMv9CmHvIx5gd W2xLC8Y1Mp4wQEkKpG4T/egYDJEA2PHF2yHN2nrtiu5p3t17uFw1ZfmefFkbYd6gvSFP gqbXUwK0cUMqslYSDgXRXy5WIfcamumQ9afIwahWmLCb86DSS1cEujq7/p+RoYU1XLnt 2HM+DYevSdbcDlQE1ebemcWSUgeLuoTvbs8UeJgj071DMfQHHDNIQIPRb3sE8E6/jnKk EFHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697861476; x=1698466276; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BNlwpXUkbxUVcz+pkcqjWSLAYAlLV5zJTHIqaZH0PvI=; b=ga2GiN+6aVnx/f2KMTbjSmLo7lTAKQtMKfkgSgcBG6G5hdCQFgbLvxdi5gN5uDUgRs a94UBE1NHap7rrZ+hAiiR4ZHjNCJ32q6aOrQpAGHvRLWmzM2nhEBBbt1+1mWIRD3TMDd yA7V/0fCLSuWZm7NOdOH39EemEzPj423fWqKZvq/TxFtQE7dS2pRUsS5Ew3OUvDyAqn1 059HtHCUfUO9bQbUSJFvZC//TuFn9hacPVNz5D1E34RFJW08+NxlDAgK+ifNifcMea/V CVNtYHzXn0Q6eJrNQTcKa2xZsO46HY4o+IEwnBhMuxlYqUBUH8UL/NkyNKAhxxMZZ4EG HZwQ== X-Gm-Message-State: AOJu0YxU5nPXW+KWTCkq3GrP4KP6/KrgV7iJUAm33UID4tHR7RzTt6FV x49Tq6P9JtdpcZ2XHzukNUY= X-Google-Smtp-Source: AGHT+IGwZihN14V5/LZuEo6mGBzwvMXC7EvVZocKCmMsJfwSxiXvlJTAHHR0iVBwq1ebovc/jTnsIw== X-Received: by 2002:a05:6871:4683:b0:1e9:ccec:645a with SMTP id ni3-20020a056871468300b001e9ccec645amr4217483oab.44.1697861475794; Fri, 20 Oct 2023 21:11:15 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id gm22-20020a17090b101600b002635db431a0sm2145998pjb.45.2023.10.20.21.11.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Oct 2023 21:11:15 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3731.700.6) Received-SPF: pass client-ip=2001:4860:4864:20::30; envelope-from=casouri@gmail.com; helo=mail-oa1-x30.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-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:311632 Archived-At: --Apple-Mail=_5BE25764-9B84-4DA1-9C58-9F5AA5CC4718 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 (Adding emacs-devel back to CC) > On Oct 18, 2023, at 1:32 AM, Huan Nguyen = wrote: >=20 > My copyright assignment process is done. Great! I=E2=80=99ve pushed it to master. Eli, do we need a NEWS entry = for this change? We are adding a new keyword for = treesit-font-lock-rules. I attached the merged patch below. Yuan --Apple-Mail=_5BE25764-9B84-4DA1-9C58-9F5AA5CC4718 Content-Disposition: attachment; filename=0001-New-keyword-default-language-in-treesit-font-lock-ru.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-New-keyword-default-language-in-treesit-font-lock-ru.patch" Content-Transfer-Encoding: quoted-printable =46rom=2070c3bfdafa46a5389b25fab322ca2c2bb75f3583=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Huan=20Nguyen=20=0ADate:=20= Sat,=207=20Oct=202023=2012:03:55=20+0200=0ASubject:=20[PATCH]=20New=20= keyword=20:default-language=20in=20`treesit-font-lock-rules'=0A=20= function.=0A=0A*=20lisp/treesit.el=20(treesit-font-lock-rules):=0A= Keyword=20:default-language=20`LANGUAGE'=20will=20be=20chosen=20for=20= every=20:feature.=0AUsing=20:language=20will=20override=20the=20= :default-language=20for=20the=20next=20:feature.=0A---=0A=20= lisp/treesit.el=20|=2044=20+++++++++++++++++++++++++++-----------------=0A= =201=20file=20changed,=2027=20insertions(+),=2017=20deletions(-)=0A=0A= diff=20--git=20a/lisp/treesit.el=20b/lisp/treesit.el=0Aindex=20= 402417c..31ebd50=20100644=0A---=20a/lisp/treesit.el=0A+++=20= b/lisp/treesit.el=0A@@=20-922,12=20+922,21=20@@=20= treesit-font-lock-rules=0A=20=20=20=20=20=20=20=20=20=20=20;;=20that=20= following=20queries=20will=20apply=20to.=0A=20=20=20=20=20=20=20=20=20=20= =20current-language=20current-override=0A=20=20=20=20=20=20=20=20=20=20=20= current-feature=0A+=20=20=20=20=20=20=20=20=20=20;;=20default-language=20= will=20be=20chosen=20when=20current-language=20is=20not=20set=0A+=20=20=20= =20=20=20=20=20=20=20default-language=0A=20=20=20=20=20=20=20=20=20=20=20= ;;=20The=20list=20this=20function=20returns.=0A=20=20=20=20=20=20=20=20=20= =20=20(result=20nil))=0A=20=20=20=20=20=20=20(while=20query-specs=0A=20=20= =20=20=20=20=20=20=20(let=20((token=20(pop=20query-specs)))=0A=20=20=20=20= =20=20=20=20=20=20=20(pcase=20token=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20;;=20(1)=20Process=20keywords.=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (:default-language=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20(let=20= ((lang=20(pop=20query-specs)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(when=20(or=20(not=20(symbolp=20lang))=20(null=20lang))=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(signal=20= 'treesit-font-lock-error=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20`("Value=20of=20:default-language=20should=20= be=20a=20symbol"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20,lang)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(setq=20default-language=20lang)))=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20(:language=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20(let=20= ((lang=20(pop=20query-specs)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(when=20(or=20(not=20(symbolp=20lang))=20(null=20lang))=0A@@=20= -955,23=20+964,24=20@@=20treesit-font-lock-rules=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(setq=20current-feature=20var)))=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20(2)=20Process=20query.=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20((pred=20treesit-query-p)=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20(when=20(null=20current-language)=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(signal=20'treesit-font-lock-error=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20`("Language=20= unspecified,=20use=20:language=20keyword=20to=20specify=20a=20language=20= for=20this=20query"=20,token)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= (when=20(null=20current-feature)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(signal=20'treesit-font-lock-error=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20`("Feature=20unspecified,=20use=20= :feature=20keyword=20to=20specify=20the=20feature=20name=20for=20this=20= query"=20,token)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= (treesit-compiled-query-p=20token)=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(push=20`(,current-language=20token)=20result)=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(push=20`(,(treesit-query-compile=20= current-language=20token)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20t=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20,current-feature=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20,current-override)=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20result))=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20Clears=20any=20configurations=20set=20= for=20this=20query.=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20= current-language=20nil=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20current-override=20nil=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20current-feature=20nil))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20(let=20((lang=20(or=20default-language=20current-language)))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20(null=20lang)=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(signal=20= 'treesit-font-lock-error=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20`("Language=20unspecified,=20use=20= :language=20keyword=20or=20:default-language=20to=20specify=20a=20= language=20for=20this=20query"=20,token)))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(when=20(null=20current-feature)=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(signal=20'treesit-font-lock-error=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= `("Feature=20unspecified,=20use=20:feature=20keyword=20to=20specify=20= the=20feature=20name=20for=20this=20query"=20,token)))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(if=20(treesit-compiled-query-p=20token)=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(push=20= `(,lang=20token)=20result)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(push=20`(,(treesit-query-compile=20lang=20token)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20t=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ,current-feature=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20,current-override)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20result))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Clears=20any=20configurations=20set=20for=20= this=20query.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20= current-language=20nil=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20current-override=20nil=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20current-feature=20nil)))=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20(_=20(signal=20'treesit-font-lock-error=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= `("Unexpected=20value"=20,token))))))=0A=20=20=20=20=20=20=20(nreverse=20= result))))=0A--=20=0A2.41.0=0A=0A= --Apple-Mail=_5BE25764-9B84-4DA1-9C58-9F5AA5CC4718--