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, 12 Dec 2024 09:17:44 +0200 Organization: LINKOV.NET Message-ID: <87frmtbc9z.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> <5192B278-66C0-48AE-B881-E57CCBB6B501@gmail.com> 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="30469"; 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 , Stefan Monnier , 73404@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 12 08:24:17 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 1tLdYX-0007o2-2m for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Dec 2024 08:24:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLdYL-0002AM-CG; Thu, 12 Dec 2024 02:24: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 1tLdYJ-0002AE-Cg for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 02:24: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 1tLdYJ-0008QU-49 for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 02:24: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=jQgY+ngXLgw9ZyWUY3Lzql1G59keRGX3cffeRBNqM0c=; b=oeOtVE+8lKLXSp5RO7fN7h+LQMEeRvNj8CSsv+KxanBIWuoGCB0ROOYIds/e912rfaQvuRboqFARZZQiROvwYTGCSXqKd6gLWXJaLD3Ar5UQrMoRZW4/Yxmh+pFWT4cNuE6r2ysWxbmItHrwTYekxWTbDr8QmRf1ARHc/sqkrJTOlDk4xafssDc2j4gRYXMzSDifGOg//Qnb2ttQwMGQ6ruFNvoWtffP+cfG6saAoh2aJnHgHQFeP8qrx/kSFs0aUCDgXwjt1hcuF6h49cTkFE4sXIyayF4aDsc1Rp+QP0XPkiR98QbZasqSwZrv6OFJz3UzDfPlApIbHDgbH/EqnQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLdYI-0003Kv-6U for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 02:24: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, 12 Dec 2024 07:24: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.173398821012776 (code B ref 73404); Thu, 12 Dec 2024 07:24:02 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 12 Dec 2024 07:23:30 +0000 Original-Received: from localhost ([127.0.0.1]:37372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLdXm-0003K0-8L for submit@debbugs.gnu.org; Thu, 12 Dec 2024 02:23:30 -0500 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:36763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLdXh-0003Je-Vh for 73404@debbugs.gnu.org; Thu, 12 Dec 2024 02:23:28 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id BDD0960003; Thu, 12 Dec 2024 07:23:12 +0000 (UTC) In-Reply-To: <5192B278-66C0-48AE-B881-E57CCBB6B501@gmail.com> (Yuan Fu's message of "Wed, 11 Dec 2024 10:27: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:296888 Archived-At: >>> 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. >> >> FWIW, we have both `forward-list` and `forward-list` and the new >> behavior you suggest sounds closer to the historical behavior of >> `forward-list` than `forward-sexp`. > > Actually, what’s the difference between forward-list and forward-sexp? > I always thought they are the same at least for Lisp. forward-sexp moves over a balanced parenthetical group like forward-list does. Plus forward-sexp also moves over an atom such as a symbol, a number. The problem is that treesit adds too much structural information to such simple things as a symbol and a number. For example, in js a simple keyword "export" gets the "(export_statement export" subtree, Another keyword "const" gets "(lexical_declaration kind: const", etc. Therefore for such symbols forward-sexp needs to bypass the structure and use simpler syntactic information to move over them like on a flat list.