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#67117: [PATCH] Tree-sitter: fix an issue when searching subtree backward Date: Sun, 19 Nov 2023 08:40:51 +0200 Message-ID: <83jzqekzyk.fsf@gnu.org> References: <87h6lruah2.fsf@yandex.ru> <83y1ezqhhk.fsf@gnu.org> <3B375BD3-CF92-4473-AC46-50D6052B79C2@gmail.com> <831qcmmh0e.fsf@gnu.org> <31EB2F37-286D-4910-958B-0152A85E970F@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="30471"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67117@debbugs.gnu.org, dvzubarev@yandex.ru To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 19 07:42:08 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 1r4bVP-0007jk-J5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Nov 2023 07:42:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4bVL-0003fA-BH; Sun, 19 Nov 2023 01:42: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 1r4bVJ-0003ep-Dp for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2023 01:42:01 -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 1r4bVJ-000347-4u for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2023 01:42:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r4bVK-00062i-CE for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2023 01:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Nov 2023 06:42: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.170037608123158 (code B ref 67117); Sun, 19 Nov 2023 06:42:02 +0000 Original-Received: (at 67117) by debbugs.gnu.org; 19 Nov 2023 06:41:21 +0000 Original-Received: from localhost ([127.0.0.1]:49819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4bUe-00061S-Sc for submit@debbugs.gnu.org; Sun, 19 Nov 2023 01:41:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4bUc-00061B-Og for 67117@debbugs.gnu.org; Sun, 19 Nov 2023 01:41:19 -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 1r4bUV-00031O-HD; Sun, 19 Nov 2023 01:41:11 -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=8HdgjnSxAInC1UmDuvkTMA7BikKKaXpPK2W5E5Z7aes=; b=OT1Z/li6LH6C4B9OWa75 cMaQ6EhrDuKnA+Oc6x42Q9NOWBgknt0xBae/CopKrBCZTG27TjOnWVARITmDgGx9LKelQB1l+Uxsq +eLRznALu8QyVH8h7OhUZQ1eS1lYEEKcwrF+wCBEwnMLtRngJWnpkMzDr48qyHr8KHSQ2oMgUYNux UmdyQxc3y8ITZyTAW21XOjnZ3S8T/nT5D3bXy4WN2oriko5OU9qETpQ3wWvwVqu9Zpv7JrIJVqzOW 9RmMgI6w9VOKqz0wv5sDziPqMdN4v8FUCL8CEQM7jqM+fdTNX96xrBwIaMWYilGCGBZ5+UJjCMLJJ LRJcPvZ441XiKw==; In-Reply-To: <31EB2F37-286D-4910-958B-0152A85E970F@gmail.com> (message from Yuan Fu on Sat, 18 Nov 2023 22:13:49 -0800) 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:274595 Archived-At: > From: Yuan Fu > Date: Sat, 18 Nov 2023 22:13:49 -0800 > Cc: dvzubarev@yandex.ru, > 67117@debbugs.gnu.org > > > > > On Nov 18, 2023, at 9:47 PM, Eli Zaretskii wrote: > > > >> From: Yuan Fu > >> Date: Sat, 18 Nov 2023 10:47:47 -0800 > >> Cc: Denis Zubarev , > >> 67117@debbugs.gnu.org > >> > >> > >>>> Steps to reproduce the issue: > >>>> 1. emacs -Q > >>>> 2. M-x find-file /tmp/t.py > >>>> 3. paste to the buffer > >>>> > >>>> Temp(1, 2) > >>>> > >>>> 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. > >>> > >>> Yuan, any comments to the patch and the issue in general? > >> > >> LGTM. Thanks Denis, and Eli :-) > > > > Should we install this on the emacs-29 branch or on master? > > Emacs-29, I’d say, since it’s a bug fix. Why do you ask? Because I want to install it, obviously.