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: Wed, 25 Dec 2024 09:44:09 +0200 Organization: LINKOV.NET Message-ID: <871pxw430m.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> <87wmfwqg7e.fsf@mail.linkov.net> <87ikr8hpdu.fsf@mail.linkov.net> <856C1B51-D9BC-4794-95CF-28E9B9B59325@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33991"; 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: Mickey Petersen , Eli Zaretskii , Theodor Thornhill , 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 Wed Dec 25 09:12:39 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 1tQMVT-0008is-HE for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Dec 2024 09:12:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQMUv-0000BG-E5; Wed, 25 Dec 2024 03:12:05 -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 1tQMUt-0000AZ-QR for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 03:12:03 -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 1tQMUt-0003Lz-Hg for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 03:12:03 -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=d0igLkvw7SavMJGDoawuEkNgr/PUd94DN2fRFac77cY=; b=gC+2GWvwoJOlMJyy+u3gudUH64kp96DgmhxAh7iJoPZ0XOWaGNYf3B8LDOb79XtXWZTio0qU0zikh49L2sY8SvCSl1jBrzmQ1FkUGCETp/JF4CRIffF77BUunh/JKafl2Y8zaBogqitwdCtxJzywVCyqDawGw3lK/cou/5qzrwbx455O5ubRrkgnkD+ZZuP9wko7hBbRtT4fw4lx+F2NX8xSPy08gxJStJi8ffamWOHNsh+sK4uOB8cTaEboiZGITUvdgE1A9M2ykEPsthqWYmiHW95/ljPxj/szFkUW4Ld9aGozAU/svo5T4hp5ECV88QKB4GIAXlcNgwMiDWeYNQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQMUt-0005t2-C0 for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 03:12:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Dec 2024 08:12:03 +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.173511427322524 (code B ref 73404); Wed, 25 Dec 2024 08:12:03 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 25 Dec 2024 08:11:13 +0000 Original-Received: from localhost ([127.0.0.1]:36054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQMU5-0005rD-5d for submit@debbugs.gnu.org; Wed, 25 Dec 2024 03:11:13 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:37047) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQMU2-0005qp-VB for 73404@debbugs.gnu.org; Wed, 25 Dec 2024 03:11:11 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 7A8B61C0002; Wed, 25 Dec 2024 08:10:41 +0000 (UTC) In-Reply-To: <856C1B51-D9BC-4794-95CF-28E9B9B59325@gmail.com> (Yuan Fu's message of "Tue, 24 Dec 2024 13:14:29 -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:297720 Archived-At: >> For html-ts-mode a list node is "element", and the node to skip >> is "tag". So for example: >> >> -!-text >> >> 'C-M-f' will use node "element" to move to the beginning of "element": >> >> text -!- >> >> then to get inside also need to skip the tag: >> >> text -!- > > Right, the thing navigation only supports going up/outside, but not going > down/inside. We can add a new thing for beginning and end of balanced > pairs. Then down-list will be going from the start of a balanced-pair-open > to the end of it. Up-list will be going from the start of > a balanced-pair-close to the end of it. Probably we could use just such heuristics that 'down-list' should skip the first node of the balanced pair. This should work for most ts-modes. For example, for 'jsx_element' the first child to skip is 'jsx_opening_element'. For 'argument_list' the first child to skip is an anonymous node "(". For 'statement_block' the first child to skip is an anonymous node "{".