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.bugs Subject: bug#74612: 30.0.90; [PATCH] Allow passing nil to treesit-node-match-p Date: Fri, 29 Nov 2024 16:38:22 -0800 Message-ID: <2D3B1979-C9A2-4843-8F64-DC26FA42EE25@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_0CC2C434-50BB-4694-8B1E-30BCE70C4125" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7831"; mail-complaints-to="usenet@ciao.gmane.io" To: 74612@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 30 01:39:36 2024 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 1tHBWK-0001tx-Hg for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Nov 2024 01:39:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tHBVu-0001Fe-6K; Fri, 29 Nov 2024 19:39:10 -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 1tHBVm-0001FI-U7 for bug-gnu-emacs@gnu.org; Fri, 29 Nov 2024 19:39:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tHBVm-0002zO-92 for bug-gnu-emacs@gnu.org; Fri, 29 Nov 2024 19:39:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:Mime-Version:From:To:Subject; bh=vWsrzbvO+sWW7ro6dJ8gduU55XBvEI8Wbz/L8S8ZDKE=; b=t1PsDlNFC+7Qk+3lZYNXEbtiZVzXbGOqyTsVvFsKLQ0tnzm00Dt26arPZchQFmIMqoyVVCwy5u/Kx61fvNIzqoWmw1z548SroJKUIrCx3Y5UL5FabguYT1IaZSaQ9ihF0fTvDVyHpuypNPVlWI4Ao5E5eHvHMXsUJr6igxjYKvKoAyVrVbJYY9B2WoVQWss7MkIJPXGcuw2wjMdQV5AlHQt7cpnvwNdFFNT8FH4AlxchpE1OaHQ5Nfi3PNL3FPatPRknlUc/iTCB5pnESlKwBlvET46UBcm1+TST0wUzVqddP7a+ptRorIR2xNykA8b694QV2gp0K63kvPc2RSWQPw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tHBVl-00032a-RW for bug-gnu-emacs@gnu.org; Fri, 29 Nov 2024 19:39:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Nov 2024 00:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74612 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: Bug Report Emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.173292712411648 (code B ref -1); Sat, 30 Nov 2024 00:39:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Nov 2024 00:38:44 +0000 Original-Received: from localhost ([127.0.0.1]:44842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHBVU-00031o-66 for submit@debbugs.gnu.org; Fri, 29 Nov 2024 19:38:44 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:42322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHBVQ-00031b-OC for submit@debbugs.gnu.org; Fri, 29 Nov 2024 19:38:41 -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 1tHBVP-0001EK-Uf for bug-gnu-emacs@gnu.org; Fri, 29 Nov 2024 19:38:40 -0500 Original-Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tHBVN-0002qI-8R for bug-gnu-emacs@gnu.org; Fri, 29 Nov 2024 19:38:38 -0500 Original-Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-724e5fb3f9dso2114591b3a.3 for ; Fri, 29 Nov 2024 16:38:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732927114; x=1733531914; darn=gnu.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=vWsrzbvO+sWW7ro6dJ8gduU55XBvEI8Wbz/L8S8ZDKE=; b=NNyWh53/lkbbd/u8MEL1IJa9DyIFNQYQvAbeThWAmXRRSfWNTJQLC70RkGVi7Q9BCH RTWBIzWfIYPvqPX7z4CMitCd3/7Z1lOv9nfIJZGdiyzNUXqm7+JYh2xE/52TIRlfos+7 IbbITQYKB9wtLDtPIlgxwN4HIOGz/BkwLJxUhC8qmnpsXXxSMYo1mEKeJa5+j7RMc+Mv gm+Y/vuHnXt6c8tqLAzmLNjslce0XsyeI3LDJ5eIDOg2bG/pyB3j5L0aYPmtF+d+KkI7 IjkAFWy4pw9CrX0hm5y1SS4zSWX2a8PTZk/N4XO8Ct8Dm0drQetf1+RefshxV7hZKqh+ zJqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732927114; x=1733531914; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=vWsrzbvO+sWW7ro6dJ8gduU55XBvEI8Wbz/L8S8ZDKE=; b=rJCmgmLVE3oTRCE+Jdj43AHlB0cPJ7JkUiNzsyN8/tX4kA8VcDb7esMelfs2GL6GHp dM2ACdmUe+Vqmk9Ua2ZHLe34BQogZ6k0MEhMF+UqvLTZeQ/aAqBYGCrmrIKYTJCM2ytL Qzz8EoYBWrGPaOFG7/6UXKmuEYExX0GIjPbRAz6cswEYgwBZ+5CH6yYFgJKhbCD6WmRg rk7bSRCQ5M0bzX7OEo9/eUVUYBkg7ZVSVSFX6q7Pb5J3Fwv0/erk83huwnhF5hriO3xX tH/J/LOn3JSZNj8LndcVmJiel/0bAJA/b/XIdy/pIZYYLY9LVUktIUZVvLZpSQQFv4Gj KLvg== X-Gm-Message-State: AOJu0Ywyg9DZyZG0cEBUWDVPDEG1Mhce7ynIua98sN/tgn/lHzIZnYmS jnYyTH07BqnjBhIPKhRw1dnEeN3OLbMUhdKOjbUwkYc1so0ltlNDnYEXjA== X-Gm-Gg: ASbGncvL95D07AkYxlyFZifS+XsGOv+tZf+0dAchUaeGtSOOU33mvxxiGOo20BRi3nl SQ79rYs0//y/+extlFe2ByN7kYyZxWvVzpeqCdAp/htfC+ZsBdbucmO/nddfzEfaObhlBrvqth/ +9l4dw9B9EiDeIZQgiE4Po+hKs2oBveNAyAS7zYAQrUOR9Th/G1B6br6SNibJ80IYdM3eRxmIGk owuu8fxr7JFcnTLK2akgg1CzibRM4l4ExONFcT47V31Fkhs20+1ovwtW6oCH63O9G2+i1o0xQ== X-Google-Smtp-Source: AGHT+IGUaQ+lf82nTDrJMCJAxmirVPyaB6N9aloq87F1CMOQFWd/yPMToonVr4GB7u3uQTFi2iezeA== X-Received: by 2002:a05:6a00:809:b0:724:680d:d12c with SMTP id d2e1a72fcca58-72530060ccamr15959303b3a.12.1732927114381; Fri, 29 Nov 2024 16:38:34 -0800 (PST) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:71b7:718f:7faa:8436]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7254176fc40sm4066872b3a.71.2024.11.29.16.38.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Nov 2024 16:38:33 -0800 (PST) X-Mailer: Apple Mail (2.3776.700.51) Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=casouri@gmail.com; helo=mail-pf1-x42a.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: 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:296108 Archived-At: --Apple-Mail=_0CC2C434-50BB-4694-8B1E-30BCE70C4125 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Eli, are you ok with this patch on emacs-30? Almost all tree-sitter node = functions allows user to pass nil for NODE, so treesit-node-match-p = should too. Yuan --Apple-Mail=_0CC2C434-50BB-4694-8B1E-30BCE70C4125 Content-Disposition: attachment; filename=treesit-node-match-p.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="treesit-node-match-p.patch" Content-Transfer-Encoding: quoted-printable =46rom=209ab20d03e30e46e2b8502877de68eec0b511d3da=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Fri,=20= 29=20Nov=202024=2016:33:28=20-0800=0ASubject:=20[PATCH]=20Allow=20= passing=20nil=20to=20treesit-node-match-p=0A=0A*=20src/treesit.c=20= (Ftreesit_node_match_p):=20Return=20nil=20if=20NODE=20is=20nil.=0A---=0A=20= src/treesit.c=20|=205=20++++-=0A=201=20file=20changed,=204=20= insertions(+),=201=20deletion(-)=0A=0Adiff=20--git=20a/src/treesit.c=20= b/src/treesit.c=0Aindex=204031d80f7c9..cda6d4af2ee=20100644=0A---=20= a/src/treesit.c=0A+++=20b/src/treesit.c=0A@@=20-4017,7=20+4017,8=20@@=20= DEFUN=20("treesit-node-match-p",=0A=20`treesit-thing-settings',=20or=20a=20= predicate,=20like=20regexp=20matching=20node=0A=20type,=20etc.=20=20See=20= `treesit-thing-settings'=20for=20more=20details.=0A=20=0A-Return=20= non-nil=20if=20NODE=20matches=20PREDICATE,=20nil=20otherwise.=0A+Return=20= non-nil=20if=20NODE=20matches=20PREDICATE,=20nil=20otherwise.=20=20If=20= NODE=20is=0A+nil,=20return=20nil.=0A=20=0A=20Signals=20= `treesit-invalid-predicate'=20if=20there's=20no=20definition=20of=20= THING=0A=20in=20`treesit-thing-settings',=20or=20if=20PREDICATE=20is=20= malformed.=20=20If=0A@@=20-4025,6=20+4026,8=20@@=20DEFUN=20= ("treesit-node-match-p",=0A=20definition,=20but=20still=20signal=20for=20= malformed=20PREDICATE.=20=20*/)=0A=20=20=20(Lisp_Object=20node,=20= Lisp_Object=20predicate,=20Lisp_Object=20ignore_missing)=0A=20{=0A+=20=20= if=20(NILP=20(node))=20return=20Qnil;=0A+=0A=20=20=20CHECK_TS_NODE=20= (node);=0A=20=0A=20=20=20Lisp_Object=20parser=20=3D=20XTS_NODE=20= (node)->parser;=0A--=20=0A2.39.5=20(Apple=20Git-151)=0A=0A= --Apple-Mail=_0CC2C434-50BB-4694-8B1E-30BCE70C4125--