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: Sun, 05 Jan 2025 19:59:31 +0200 Organization: LINKOV.NET Message-ID: <877c79qhcs.fsf@mail.linkov.net> References: <87plox4mtp.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> <8734i5fyv1.fsf@mail.linkov.net> <875xmumpzv.fsf@mail.linkov.net> <86ikqubdsd.fsf@gnu.org> <87wmf9912l.fsf@mail.linkov.net> <87a5c5v5z8.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26576"; 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: Eli Zaretskii , mickey@masteringemacs.org, casouri@gmail.com, monnier@iro.umontreal.ca, 73404@debbugs.gnu.org To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 19:25:30 2025 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 1tUVJZ-0006mo-1q for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 19:25:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUVJC-0004aY-A3; Sun, 05 Jan 2025 13:25: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 1tUVJ8-0004Xs-ND for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 13:25: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 1tUVJ8-0004xl-DS for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 13:25: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=G6277/6AntJL7Q+OSrRgdTvSInUWlrhoc/e4j0XPnC4=; b=VqxsJV5/yw99xjqnwZ3X6auI0ExQJfOT6O6bfKVZcESr791wpjSk4UbXvGJg9jzNSQ+iAuAIsXHSup06rgXPCa3aqZZdICBMD6HG03JGvuWLsaTBJq3UEYTkPIPRn0gXCVABp1H8sv6bBwa4s0/g0NO1yMC39wOw5C/utS9ab3AWz8y9VlDwL7CwNYO/ka4RQrnmelsExzYpdJpKJOihYOD/3u2QYgn59oOajrvPoMGka16Cf4GoxmonMebbLDMC7/xpGzdEw+/P/bbs89qkKvUvL1bkGeKp4Uk6Iw92d8hC0d3WQ/LTov/JPBurkbgCoqiosOokCcpPBGk4ghV6Sw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUVJ8-0001TN-8i for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 13:25: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: Sun, 05 Jan 2025 18:25: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.17361014835597 (code B ref 73404); Sun, 05 Jan 2025 18:25:02 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 5 Jan 2025 18:24:43 +0000 Original-Received: from localhost ([127.0.0.1]:35153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUVIp-0001SC-69 for submit@debbugs.gnu.org; Sun, 05 Jan 2025 13:24:43 -0500 Original-Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]:38693) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUVIn-0001Rp-GN for 73404@debbugs.gnu.org; Sun, 05 Jan 2025 13:24:42 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 6988D40002; Sun, 5 Jan 2025 18:24:31 +0000 (UTC) In-Reply-To: <87a5c5v5z8.fsf@thornhill.no> (Theodor Thornhill's message of "Sun, 05 Jan 2025 12:46:03 +0100") 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:298588 Archived-At: >> The command is 'forward-list'. With 'list' it will do in ts-modes >> the same that 'forward-list' already does in non-ts modes. > > One issue I've had when exploring these things earlier is that I don't > know the "spec" for how navigation in programming languages should work > in Emacs. I mean, there are lots of examples in the source code, but no > true specification. Should we possibly try to define some sane defaults > here, so that it will be simpler to deal with idiosyncrasies of the tree > sitter parsers? Lisp isn't in my experience the best language to define > this, as it is just too simple. Very simple: I'm striving to provide compatibility between ts-modes with their predecessor non-ts modes. So the de-facto "spec" is the existing non-ts modes that provide canonical reference implementation. This helps the users to more smoothly switch to ts-modes. > Also, many of the functions are related to word processing, like > sentence, word, paragraph etc, which aren't really useful in > programming, imo. What is a sentence in java, lisp, or python, for > example? Also, maybe sexp is too lisp/ast-like of a term, so much so > that it is hard to reason about what a sexp is or isn't. Indeed, sentences and paragraphs are even more fuzzy concepts when applied to programming languages. But some modes make sense of these things nevertheless. For example, in both c-mode and c-ts-mode 'M-e' moves to the end of statement that usually end with a semicolon; so your intuition about these things looks correct.