From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#73404: 30.0.50; [forward/kill/etc]-sexp commands do not behave as expected in tree-sitter modes Date: Thu, 19 Dec 2024 09:34:15 +0200 Organization: LINKOV.NET Message-ID: <87wmfwqg7e.fsf@mail.linkov.net> References: <87plox4mtp.fsf@masteringemacs.org> <87frpm20t7.fsf@masteringemacs.org> <8634lmbs8t.fsf@gnu.org> <87bk0a1u0o.fsf@masteringemacs.org> <86tte2a5o3.fsf@gnu.org> <877cay1lqt.fsf@masteringemacs.org> <86frpma06f.fsf@gnu.org> <86ikueiekp.fsf@mail.linkov.net> <86ed4zg1cc.fsf@mail.linkov.net> <87zflac68t.fsf@mail.linkov.net> <87jzcdlxdp.fsf@mail.linkov.net> <87o71jocgs.fsf@mail.linkov.net> 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="18176"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: Theodor Thornhill , Eli Zaretskii , Mickey Petersen , 73404@debbugs.gnu.org, Stefan Monnier To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 19 08:37:35 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 1tOB6E-0004a5-U7 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Dec 2024 08:37:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOB5k-0000NC-C4; Thu, 19 Dec 2024 02:37: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 1tOB5i-0000Mx-SD for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2024 02:37: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 1tOB5i-0000O2-K2 for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2024 02:37:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=ZRW3JKoGD0ZJJDCjD6c9o6olwkjpvHPioOrhudnRxJE=; b=UmXaFZ+axfYhEbdPLv003m1KYs710BHCwgniHOXWhvxJLe2Lp6uPRy/GD+AYN+Gu46Dp+CUggu7xdu4Q3MbaY0cy1JMa7GqT9vHZLtO9jZgXrcEjaEHpU5sDd6LFdqX/fSQ+mWEN2PbvOdaWGZgMTQ/cRF1J41jXwOsOrcLBoG3zG8HVX/r4V3RijsRJm8L0/npXVVOBhfTz0ARIvPthQN3rxuj/31nmasJStqIX7ozPUGwVU10QQ1xINM9Q8qS1ok/6QbemxexjhgTpDm1DwW7T1a9eZz4Tmlubg9XioerQGwVH+h9Urpghf0F7nxtLxLxov8NkGnKTkvnZovxQOg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOB5i-0007lV-4d for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2024 02:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Dec 2024 07:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73404 X-GNU-PR-Package: emacs Original-Received: via spool by 73404-submit@debbugs.gnu.org id=B73404.173459377929784 (code B ref 73404); Thu, 19 Dec 2024 07:37:02 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 19 Dec 2024 07:36:19 +0000 Original-Received: from localhost ([127.0.0.1]:37260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOB50-0007kJ-QT for submit@debbugs.gnu.org; Thu, 19 Dec 2024 02:36:19 -0500 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:41779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOB4y-0007k4-FQ for 73404@debbugs.gnu.org; Thu, 19 Dec 2024 02:36:16 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 1AE0A20003; Thu, 19 Dec 2024 07:35:47 +0000 (UTC) In-Reply-To: (Yuan Fu's message of "Tue, 10 Dec 2024 22:31:26 -0800") X-GND-Sasl: juri@linkov.net 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:297364 Archived-At: >> What should remain in 'treesit-thing-settings' are only grouping >> constructs such as "parenthesized_expression" and "statement_block". > > Ah, this matches my idea of defining sexp in other languages as “repeatable > construct/list-like construct”. We went with “every syntactic construct” at > the time, which I didn’t object to, but I’m definitely happier with the > repeatable construct approach. Including Stefan and Theo since they were > part of the original sexp navigation discussion. > > My only concern is that would the result be a bit unpredictable/confusing > when we mix the result of two logic together in such an involved way? We > can push to master and try it out for a while. I use tree-sitter sexp > navigation for work every day, albeit strictly for navigating list-like > constructs—I use forward/backward-word for smaller navigation. > >> tries to go out of the current thing to its parent, >> thus breaking the main principle that 'forward-sexp' >> should move forward across siblings only. But removing >> this line fixed the problem: > > Thanks, LGTM. Ok, so now pushed to master in such backwards-compatible way that when a ts-mode doesn't define the 'sexp-list' thing, then the existing 'sexp' is used. Also added 'sexp-list' to c-ts-mode, js-ts-mode, ruby-ts-mode and html-ts-mode. Addition of 'sexp-list' to other ts-modes is underway.