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: Tue, 24 Dec 2024 21:05:37 +0200 Organization: LINKOV.NET Message-ID: <87ikr8hpdu.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20291"; 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 Tue Dec 24 20:10:31 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 1tQAIX-00056t-5S for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Dec 2024 20:10:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQAIA-00084j-Ks; Tue, 24 Dec 2024 14:10:06 -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 1tQAI8-00083O-HU for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 14:10:04 -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 1tQAI7-0005bi-VG for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 14:10:04 -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=Xxc3ErPSZTlrSW/uF1FUbTjgpARGchSi7G3KzjOQYXg=; b=b5wZDs8uOhlGlCK8at5Bc0krh66UP75oDBjNHcHmDcieUl8esY8rckbPBDCxqLqFZZlJ0OA/82pI4suAS8surlucqNjvSccuIYJ1ZHQX/ZYVIZLZbWnMUm7fHvt2012Y3zCFFNdNvQIc+bI76AGeQH5Iyevs9pUL6p+ZVgVB1r2OTYW5iL2bvDShcHq4R+tTHXxtPqBQQI2bfAM1EQdeQHxzVh170VJRSzX3VlNm3M0vljt0PlcK1pmRIp3mNbZBBIyDmD18eGWORA3JeDli3r3tJNl5Mt9M2orUs0ZXWOD40L3u6z2JOGgRtTBQZTTBh5CXw0ErAp38sSbjDFL6ow==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQAI6-0000yr-Ho for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 14:10: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: Tue, 24 Dec 2024 19:10: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.17350673863740 (code B ref 73404); Tue, 24 Dec 2024 19:10:02 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 24 Dec 2024 19:09:46 +0000 Original-Received: from localhost ([127.0.0.1]:34223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQAHq-0000yF-1A for submit@debbugs.gnu.org; Tue, 24 Dec 2024 14:09:46 -0500 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:54355) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQAHn-0000xx-TA for 73404@debbugs.gnu.org; Tue, 24 Dec 2024 14:09:44 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 1ED93E0003; Tue, 24 Dec 2024 19:09:34 +0000 (UTC) In-Reply-To: <87wmfwqg7e.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 19 Dec 2024 09:34:15 +0200") 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:297698 Archived-At: > 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 I'm looking into allowing more list-navigation commands to be usable in ts-modes. E.g. instead of limiting list-navigation only to the current 'forward-sexp', another useful command is 'down-list'. Currently to get inside an HTML element in html-ts-mode is possible by using 'M-e' (forward-sentence) to skip HTML tag. This is not quite obvious. More natural would be to support 'C-M-d' (down-list). But this requires overriding more low-level 'scan-lists' and 'scan-sexps' in treesit, instead of overriding the current top-level 'forward-sexp-function'. Also treesit-thing-settings for 'down-list' would require pairs of node names: one node to define a list, and another node to skip a node to get inside the list. 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 -!-