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 22:13:49 -0800 Message-ID: <31EB2F37-286D-4910-958B-0152A85E970F@gmail.com> References: <87h6lruah2.fsf@yandex.ru> <83y1ezqhhk.fsf@gnu.org> <3B375BD3-CF92-4473-AC46-50D6052B79C2@gmail.com> <831qcmmh0e.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="29068"; 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 Sun Nov 19 07:15:17 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 1r4b5R-0007JM-2w for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Nov 2023 07:15:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4b5E-0007KE-0F; Sun, 19 Nov 2023 01:15:04 -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 1r4b5B-0007Ji-2i for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2023 01:15: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 1r4b5A-0003Pj-QH for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2023 01:15:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r4b5C-0002Se-0L for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2023 01:15: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: Sun, 19 Nov 2023 06:15:01 +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.17003744519369 (code B ref 67117); Sun, 19 Nov 2023 06:15:01 +0000 Original-Received: (at 67117) by debbugs.gnu.org; 19 Nov 2023 06:14:11 +0000 Original-Received: from localhost ([127.0.0.1]:49801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4b4N-0002R3-Gv for submit@debbugs.gnu.org; Sun, 19 Nov 2023 01:14:11 -0500 Original-Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]:46342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4b4K-0002Qj-R6 for 67117@debbugs.gnu.org; Sun, 19 Nov 2023 01:14:10 -0500 Original-Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3b6ce6fac81so2210822b6e.1 for <67117@debbugs.gnu.org>; Sat, 18 Nov 2023 22:14:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700374442; x=1700979242; 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=suGCEoyWkcYjmah6kgM1+fR0q9bAkGqeef4oSblnVhQ=; b=KQdV7+YfiIUhgzM8tDPkff1cXRm+xvwG1yVXB+VVB5I+EXJAriE9YrvstFiDOfNqhf vbZ3KkTLC5Mh3wG+2EJPlV9pC2ppbBMalhQ1YxRpj/qoGjpzuolui55+p6G7HtfyCgKu wfTqmLxUD57Gmvq7YNxDRbEesnbjGn38VhrfhWzNxPvpm7aeEiB5wVpMcT/t/hk3Kjc8 dzCp9dXEr/N0bQrTc/3RrMzTELmhmE52ymuDkQhz7XutJ3ESyciBTY22KpDzjhPvjAPf B1ryXaNlWAiHBqPgiUkccy3uASEvw3sFXDA0Vht1z+ZOHP4Y/SJFtIyVERX1MzmSo0ZF PTrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700374442; x=1700979242; 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=suGCEoyWkcYjmah6kgM1+fR0q9bAkGqeef4oSblnVhQ=; b=KbPNqi/AaQ2etBNI1c7vBYdI70m5OVuB+IJNZ8BORLRHeap0bKqNHdck84Q+iNleme M5d88i/pGtSe78W8sZOILhtPTRiSoAtFwht8AhqX4Tvt0/al5hpMT/KQX0tH8VTQ8ci5 a8q7gI2ZZjcxsBabDptQcmVRMkBJgmfewK55zGZ2znBiTWgjl6ZLIPgCK1qvE2AAK5T5 WKx/thMw/ujCk0P7gVNZVHURU5XwnQZ7lcfz2aHSZAHOocFZGQnclMYsyEB2/J7lWshJ Xxt4461es9IWv+Iz3imUNCR5bkom003+RFT0lfKTP04WBLMQQyqQ9YrA1wMp/+ep1Yja Ls5w== X-Gm-Message-State: AOJu0Yx7CL2nfkNmGPlR3/uAs421VxaKsTl3X+dxX8cySToBoXqXf4sW gMNUj63cQGxlM2zxl8dvlH4= X-Google-Smtp-Source: AGHT+IHbEBF87C34u4PJPLrvV0t2Ottd3YJKmgatHwndKhp1OZIoWZsGovZWahk3YQJuryq4IAKS/A== X-Received: by 2002:a05:6808:3026:b0:3b6:cd77:552e with SMTP id ay38-20020a056808302600b003b6cd77552emr5633679oib.10.1700374441911; Sat, 18 Nov 2023 22:14:01 -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 c3-20020aa781c3000000b006cb7b0c2503sm569659pfn.95.2023.11.18.22.14.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Nov 2023 22:14:01 -0800 (PST) In-Reply-To: <831qcmmh0e.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:274592 Archived-At: > 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? Emacs-29, I=E2=80=99d say, since it=E2=80=99s a bug fix. Why do you ask? Yuan