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#67117: [PATCH] Tree-sitter: fix an issue when searching subtree backward Date: Sat, 18 Nov 2023 10:47:47 -0800 Message-ID: <3B375BD3-CF92-4473-AC46-50D6052B79C2@gmail.com> References: <87h6lruah2.fsf@yandex.ru> <83y1ezqhhk.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36839"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67117@debbugs.gnu.org, Denis Zubarev To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 18 19:49:19 2023 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 1r4QNb-0009JS-Mz for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Nov 2023 19:49:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4QNL-0005Ey-8B; Sat, 18 Nov 2023 13:49: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 1r4QNK-0005Ej-4C for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 13:49:02 -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 1r4QNJ-00022C-QL for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 13:49:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r4QNK-0000k5-GX for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 13:49:02 -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, 18 Nov 2023 18:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67117 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67117-submit@debbugs.gnu.org id=B67117.17003332942629 (code B ref 67117); Sat, 18 Nov 2023 18:49:02 +0000 Original-Received: (at 67117) by debbugs.gnu.org; 18 Nov 2023 18:48:14 +0000 Original-Received: from localhost ([127.0.0.1]:49521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4QMW-0000gA-3g for submit@debbugs.gnu.org; Sat, 18 Nov 2023 13:48:13 -0500 Original-Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:42229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4QMQ-0000em-Ap for 67117@debbugs.gnu.org; Sat, 18 Nov 2023 13:48:10 -0500 Original-Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1ce618b7919so10412645ad.0 for <67117@debbugs.gnu.org>; Sat, 18 Nov 2023 10:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700333279; x=1700938079; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Gg6GJJzZ4S0cCdwn0z24CEOxCkHZCWWl12wwaMwLkuQ=; b=cMKfQe31X92lWr1HD31ObG/vLwEh8LB/5nLnAtahpfAAPeBKAI4z16g3girMQ3wdHl xcetrAP60HMebsxO3O5bi0K04uX+X5QjC9p+lmFF9aOtCdQMj0mi5DQ9tyxpd4Ja3Ovw x/hxHmP96dzmhgiOjidzBz/MWuqMeFCHQr8kVcHku/KL/Vh5cUEA0daMkRjMWd7F7UUp JJTJBRiGxgwIJ9/g3mJVwr3tkgq0ZPYgh6CjOSCbBznXMrH8MIJWCfC9SqIPniEZpnBj hrxn5QB+gZsQi7Yht8W2hsNCgk7jXOmak0hWrj++mfRHZYYZW17ctCzcCFgTT+Ol1xb5 BxDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700333279; x=1700938079; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gg6GJJzZ4S0cCdwn0z24CEOxCkHZCWWl12wwaMwLkuQ=; b=iVISn8i1pBg/TtpMHPDvlZ0oxwqyVDnEdVocGKzDNKD9Alv+SYgtfnCYQx3HqjVN4C AxZO6unKWwODxzxmRVw75HP0jkhRE6Pkw+Zpba8/W1Brx5ajtzG8KeXC8BZ+bM83LN30 fGBxSWt//GEgKRVo+Ybvh+cKNecZ5879bzo8X/AnGMTdeXYXqT1kqHsieSkZhrQLw3Aa dQiauJz+C1nxMT2afLNSjpqXiOoTHGdKI6XZQarxUQwuRiftDVaQ/fkss2NBCeLuiQd1 zOZKaismt39DoTDD0z2xaXS2V18Cf1VX164Sas+sSwH9slLdr+fe9pm0C6gRnq1NK19F 2DtQ== X-Gm-Message-State: AOJu0YwJDaoip9KlOL72uwBGfP0FkTDZJ81mQtPYasTSNw1JqsVEIfW0 EJGIpAIiwuWo8sO/4U3gQPM= X-Google-Smtp-Source: AGHT+IHHDP0wnXwE59G/H07sO0VhOxX21qUNV7ow8F0YHZSGEyJ4pX22RUH41UsaPC6ya1apYVKSsA== X-Received: by 2002:a17:902:db07:b0:1c7:5776:a30f with SMTP id m7-20020a170902db0700b001c75776a30fmr3825742plx.12.1700333279360; Sat, 18 Nov 2023 10:47:59 -0800 (PST) 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 j21-20020a170902759500b001cf57ea953csm306581pll.290.2023.11.18.10.47.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Nov 2023 10:47:58 -0800 (PST) In-Reply-To: <83y1ezqhhk.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.700.6) 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:274567 Archived-At: > On Nov 15, 2023, at 5:21 AM, Eli Zaretskii wrote: >=20 >> From: Denis Zubarev >> Date: Sun, 12 Nov 2023 02:38:33 +0300 >>=20 >> Steps to reproduce the issue: >> 1. emacs -Q >> 2. M-x find-file /tmp/t.py >> 3. paste to the buffer >>=20 >> Temp(1, 2)=20 >>=20 >> 4. M-x python-ts-mode >> 5. Call search-subtree with backward flag >> M-x eval-expression (treesit-search-subtree >> (treesit--thing-at (point) "call") >> (lambda (n) (equal (treesit-node-type n ) "integer")) >> t) >> It should return the second int node (#), but it returns nil. >=20 > Yuan, any comments to the patch and the issue in general? LGTM. Thanks Denis, and Eli :-) Yuan=