From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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, 26 Sep 2024 16:46:52 +0300 Message-ID: <86tte2a5o3.fsf@gnu.org> References: <87plox4mtp.fsf@masteringemacs.org> <87frpm20t7.fsf@masteringemacs.org> <8634lmbs8t.fsf@gnu.org> <87bk0a1u0o.fsf@masteringemacs.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30090"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 73404@debbugs.gnu.org To: Mickey Petersen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 26 15:48:07 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 1stoqk-0007gH-Mz for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Sep 2024 15:48:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stoqH-0007cP-LM; Thu, 26 Sep 2024 09:47:37 -0400 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 1stoqF-0007bv-Ep for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2024 09:47:35 -0400 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 1stoqF-000166-4r for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2024 09:47:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=MQK8z6L1yU9zsurrJOLUPUSvPp+uYQ/Qrj9OT14SknA=; b=HJlCKWg/hSNTzZM+tmEyoWwae4g9ENek1N0EwxYGacyv3nmUy4NftPUw9n1xM68BsN2iNzPOn9u1SB7VicEza054SdwfwsIDSwr7fZGENke/YzldhdLXpwD3nA8gXIHX8SSNs4ulRh1dPYIfvSSdfwY28W1BuAoTSKHe+5yL7W6oF3bfUOcOccn7q1g5aKEySRTLh2TwIMM3js4kHfjLb4qEjaiwdM12ZRoGglWQGEPrgKz+SqjWtnJd54vpD7HFmdIj0OqE/7AiqHXJJ6u1anUk/SdDrjCDRX9T43cnh9vLNAg/+gZol88bFOig0EJs6GahSAnyQkYETwchS6X4xg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stoqg-0000rg-8t for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2024 09:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Sep 2024 13:48: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.17273584683263 (code B ref 73404); Thu, 26 Sep 2024 13:48:02 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 26 Sep 2024 13:47:48 +0000 Original-Received: from localhost ([127.0.0.1]:33818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stoqR-0000qV-8b for submit@debbugs.gnu.org; Thu, 26 Sep 2024 09:47:47 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stoqP-0000q2-Aw for 73404@debbugs.gnu.org; Thu, 26 Sep 2024 09:47:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stops-00015I-EM; Thu, 26 Sep 2024 09:47:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MQK8z6L1yU9zsurrJOLUPUSvPp+uYQ/Qrj9OT14SknA=; b=BxsOmYDPZU1b AkWaQ2wAeeF1AsprWzsOrepSfXfFHVYj1k6TbNFCUV/VGm+EHWqPP7MRROZsMu5WBedbuLHLzF1q7 JOEO7c1if8S1OZgk7jf1AzPy33fj9L6WuRykRLz5MjaHbdWKV8iNKS6AuaWS4YX7QGQLit3ZN9cax T8xDbSjoonY5a+eRUp3mmva+l3iDEfwQ1cr7SjrqSbS8u98GjO6XGmYKbk8QyGHHPz6gjcYQFO1kh tUqguYj5qf01Z/Fc5b7inlmEXSR0sjneHBk/s5Vnr4Xvg7k10+W8i+hYlSoDHXvwZ3RJij0imSSaF EMAHz/MUYxCGwobsK2P81Q==; In-Reply-To: <87bk0a1u0o.fsf@masteringemacs.org> (message from Mickey Petersen on Thu, 26 Sep 2024 13:13:53 +0100) 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:292461 Archived-At: > X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_RECEIVED, > NO_RELAYS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no > version=3.4.2 > From: Mickey Petersen > Cc: casouri@gmail.com, 73404@debbugs.gnu.org > Date: Thu, 26 Sep 2024 13:13:53 +0100 > > > Eli Zaretskii writes: > > > int foo = bar + 2 * baz; > > > > Suppose you start with point at "foo": what would you expect > > forward-sexp to do? nothing? > > > > I expect it to behave as it presently does: default to word-like > behaviour such as M-@ / M-f etc. Then we just lost an opportunity to have more useful commands, because we already have M-f and M-@. > Balanced expression is not well defined, de jure, but it is in > practical terms, making it de facto rather well understood and > supported. It behaves reasonably consistently across languages, and I > use *-sexp commands thousands of times a day in a wide range of major modes and > contexts, both in code and also prose. I think the ability to move by parse sub-trees is also very useful. > Most people who use *-sexp (or *-word commands for that matter) in > major modes come to recognise how they work and know what happens to > the text/point in their buffer before they run them. > > I would challenge anyone, given even small samples of code, to do the > same with the current TS only implementation. That's just a matter of getting used to the new semantics. > > I disagree. Moving by sub-trees is a natural generalization of sexp > > movement for languages where parentheses and braces are rare and far > > in-between. > > Yes, if one can intuit the sub trees' structure, which is not so > simple; and if the selection of commands are sufficiently expressive > enough to let you navigate the tree. I am not sure they are. There are enough situations where moving by words will also surprise you. For example, did you know that M-f stops when it finds a character from a different script? And yet we still use these commands.