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: Mon, 06 Jan 2025 09:54:49 +0200 Organization: LINKOV.NET Message-ID: <87o70k9y2e.fsf@mail.linkov.net> References: <87plox4mtp.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> <877c79qhcs.fsf@mail.linkov.net> <87sepxt4yl.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="1535"; 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 Mon Jan 06 08:59:26 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 1tUi1F-0000Gd-0h for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Jan 2025 08:59:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUi0u-0005Mj-3s; Mon, 06 Jan 2025 02:59: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 1tUi0s-0005MZ-Lw for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 02:59: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 1tUi0s-0001dA-Dp for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 02:59: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=72AboljeBx9UoKctceqiKJgU8NKjcTC1Awznmq89lVM=; b=I/snQxx6ped0t4J+vsu5BooTiFV6tU+yqket5SbukOmURRJfrM5yVfrTdxR18XlYrPVd6ke+FQiFpEJgHvhYAf2ruCiYOYkiOWTfD6TuGRO9jMJUJ6wqF3Q6BGzRhqmXWJUonN7elxP4ZRiTcvPewF1jfOh6ToMTIRWyZwNQmwpsf2Qw4pTL10luYphrbff0WK18xOgSIiXSYUzRC65RumcQ7Uup0ypZoGy8wxhYfPqmzHz4xUS9a+9hs4FSgxFuXaMDh7FaOee4xNAINALYHM4Ipkmh8zPoq41jclrKP7c9xF/UMyRdqaTYjULgXjgQwLUF/QWKFBBsrxxhe7LQWg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUi0r-0004S6-VN for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 02:59: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: Mon, 06 Jan 2025 07:59:01 +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.173615032717091 (code B ref 73404); Mon, 06 Jan 2025 07:59:01 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 6 Jan 2025 07:58:47 +0000 Original-Received: from localhost ([127.0.0.1]:36556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUi0c-0004Rb-KI for submit@debbugs.gnu.org; Mon, 06 Jan 2025 02:58:46 -0500 Original-Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]:60809) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUi0a-0004RL-HX for 73404@debbugs.gnu.org; Mon, 06 Jan 2025 02:58:45 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id E03AB60008; Mon, 6 Jan 2025 07:58:34 +0000 (UTC) In-Reply-To: <87sepxt4yl.fsf@thornhill.no> (Theodor Thornhill's message of "Sun, 05 Jan 2025 20:50:58 +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:298631 Archived-At: > However, deciding on what makes sense is hard, which is why I'm > suggesting we try to define a "spec". It needn't really be much more > than reference suggestions for mode implementors at first, then maybe > some intersection of features crystallize across all modes. I don't think it's possible to find a spec better than Stefan already defined as an AST node delimited by an opening and a closing "keyword": (...), [...], if...fi, begin...end, ... >> 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. > > Yes, but imo more importantly, disregarding any confusing naming we have > a very rich set of operations available to us that I think should be as > distinct as possible: > > - C-M-f > - M-f > - M-a > - M-e > - C-f > - C-a > - C-e > - more Or when looking at the commands with the 'forward-' prefix: forward-list (C-M-n) forward-page (C-x ]) forward-paragraph (M-}) forward-sentence (M-e) forward-sexp (C-M-f) forward-symbol forward-word (M-f) Interesting that a potentially useful 'forward-symbol' has no binding. > If we'll aim to get the absolute most out of the parse tree > possibilities we should strive to make these distinct, at least down the > line. Some of these are simpler to categorize than others, such as a > sentence meaning "some expression that ends that isn't a function or a > class definition". In languages with statements a sentence corresponds to a statement. Then a paragraph is a less useful concept since a group of statements compose a block that corresponds to a list, not a paragraph. Then probably the definition of a paragraph should remain as a group of lines separated by empty lines.