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: Mon, 20 Nov 2023 20:23:33 -0800 Message-ID: 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> <83jzqekzyk.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) 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="11196"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67117@debbugs.gnu.org, dvzubarev@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 21 05:24:23 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 1r5IJC-0002gr-Rk for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Nov 2023 05:24:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5IIs-0002Hv-6G; Mon, 20 Nov 2023 23:24:02 -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 1r5IIq-0002Hd-Ph for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2023 23:24:00 -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 1r5IIq-0001Jp-Hm for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2023 23:24:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r5IIs-0001sk-AV for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2023 23:24: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: Tue, 21 Nov 2023 04:24: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.17005406377223 (code B ref 67117); Tue, 21 Nov 2023 04:24:02 +0000 Original-Received: (at 67117) by debbugs.gnu.org; 21 Nov 2023 04:23:57 +0000 Original-Received: from localhost ([127.0.0.1]:54943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5IIn-0001sR-1x for submit@debbugs.gnu.org; Mon, 20 Nov 2023 23:23:57 -0500 Original-Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:43343) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5IIk-0001sD-9I for 67117@debbugs.gnu.org; Mon, 20 Nov 2023 23:23:55 -0500 Original-Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1cf6bdf8274so4226735ad.1 for <67117@debbugs.gnu.org>; Mon, 20 Nov 2023 20:23:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700540626; x=1701145426; 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=L55zdDJSGHpWTLyES5UuutwopZhO+eQvo82atjUYTFA=; b=F7heP/6u98F7X5T5piDf19I0iPBj5+4RYzVnMLG/gDzE0NmGc8O1iRSxZqOcOQ3nVZ 1JGp/gvbbNkotw1e6NxO9KXVmaKkplbJVq21RmSi2w75ODbkermZoNRB3xnYAz7/hb/b 14W/Oxsbg4oWjg4zUcRbuB3TEusEfUImazWIkOh+hte9QRncW+Oq7uLHMWXxk7N1Gqu6 rToCMXckD++1tMVgTlGTD6PJ8y3yEgkSb0Mr3UGYvz4Q+cCENoP6YxQCYHtmx2316qKu FbUK6N3c2X/X9WjVGsHY+2VNZWc2oGG0z3gEhuBFIOxUFAIvz+WMSYujH0mnKtqHVAb1 tZfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700540626; x=1701145426; 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=L55zdDJSGHpWTLyES5UuutwopZhO+eQvo82atjUYTFA=; b=eYOv/0cxnT+XRr9GAMASO5oRbcBMTsXmCDCTZ3afNkBZYqRYuJ4Vp4057OXVZWL7xw 0iwcfmmqbbMJNEzOX5W0RkGKaE2p3UAaAkhVod7XcCG/b7ocYNjic9uLbCp1poxZK8E6 sHOZNwmhP3ZZfjRcvR/yGSQiPF6cs88sysh6Hwo6vPyFiI4omPu9WNsTApoTMunFqUKw q76MDTvECXrk0QVkej7ezEtx9eAp2bqwu3D97QZW0+H0oxBW6rl8wywuhQJiuo9P2LVS D4LVxelP0Ycwi+bwP3mOOOrdP32X0JWipUCFjnnl41zrQPakatn9Dy4pE/HcsSjCPKRO yPVA== X-Gm-Message-State: AOJu0YzpsABjbtmOT27lYdLf0H19nmEM3VeQxXNNcljv3M8bfS/PFIFo kBSD+PqRt2XDJwL1UlU0q28= X-Google-Smtp-Source: AGHT+IFiyhKSZw3wuXp0kng/YOv9HBCyyY2p5oU0WCBDL0X/8nUPnQn/4spCkHV1UvyWkNErs7IzRQ== X-Received: by 2002:a17:902:db06:b0:1cc:47e7:5d5e with SMTP id m6-20020a170902db0600b001cc47e75d5emr2454648plx.19.1700540625793; Mon, 20 Nov 2023 20:23:45 -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 f14-20020a170902ce8e00b001c60c3f9508sm6830018plg.230.2023.11.20.20.23.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2023 20:23:45 -0800 (PST) In-Reply-To: <83jzqekzyk.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:274698 Archived-At: > On Nov 18, 2023, at 10:40 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Sat, 18 Nov 2023 22:13:49 -0800 >> Cc: dvzubarev@yandex.ru, >> 67117@debbugs.gnu.org >>=20 >>=20 >>=20 >>> On Nov 18, 2023, at 9:47 PM, Eli Zaretskii wrote: >>>=20 >>>> From: Yuan Fu >>>> Date: Sat, 18 Nov 2023 10:47:47 -0800 >>>> Cc: Denis Zubarev , >>>> 67117@debbugs.gnu.org >>>>=20 >>>>=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? >>>>=20 >>>> LGTM. Thanks Denis, and Eli :-) >>>=20 >>> Should we install this on the emacs-29 branch or on master? >>=20 >> Emacs-29, I=E2=80=99d say, since it=E2=80=99s a bug fix. Why do you = ask? >=20 > Because I want to install it, obviously. Of course ;-) I mean you are usually the people who answer this type of = questions, and our convention is to install bug fixes on emacs-29, so I = was wondering if there=E2=80=99s some other considerations that I = don=E2=80=99t know about. Yuan