From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 15:07:28 -0500 Message-ID: References: <87plox4mtp.fsf@masteringemacs.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> <87o70k9y2e.fsf@mail.linkov.net> <87plkzyh60.fsf@mail.linkov.net> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7481"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: mickey@masteringemacs.org, Eli Zaretskii , Theodor Thornhill , casouri@gmail.com, 73404@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 06 21:08:29 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 1tUtOl-0001kA-Rm for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Jan 2025 21:08:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUtOO-0000OG-Ul; Mon, 06 Jan 2025 15:08: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 1tUtOM-0000O0-Pn for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 15:08: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 1tUtOM-0004AL-Hb for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 15:08: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=xqciFGuTDHtP6WDXepQBh80c6AcmoCxi6U8giOJ/2z8=; b=ISidStqkEFUDQjsJARlJmlrnpz/Ae+f0szGxDt/R/8Ux4283VAv8et57tq0HLc55914ZOcE369cWo2MorAdu4wBnY1+pD5uXLr08qvixgBySmVvCvW13+j/cqQFYBpSZH60zwaOgkUGJZmAsnf5Ubrzo4zFLC7fjJSEsM94ZNjFVv0W/UUw7a6kfQBchDppVi6OadqjspvthkwrxF5uQxJfthwBhqdI1c8AZ41gJcrR5/XafeJFi4gTe4VLKR+qTzhu+y7/77cQkzdlhEMqoGIDce1uCJ1LKY2s9aMdThl5GZWsCwds6ad5V6Tffs4d3IkyObSWPJvdsEzklknjWUw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUtOM-0008CT-0q for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 15:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jan 2025 20:08: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.173619406731491 (code B ref 73404); Mon, 06 Jan 2025 20:08:01 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 6 Jan 2025 20:07:47 +0000 Original-Received: from localhost ([127.0.0.1]:40218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUtO7-0008Bp-Bx for submit@debbugs.gnu.org; Mon, 06 Jan 2025 15:07:47 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53213) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUtO4-0008BO-8j for 73404@debbugs.gnu.org; Mon, 06 Jan 2025 15:07:45 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 17AE180913; Mon, 6 Jan 2025 15:07:38 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1736194057; bh=bwTTYJ8F3u3Izx9/WhavTWnkLw738sgxIX9otPwNUWY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=R+GkePrSDf2APKqqL4G95ccHnmzAyHiLHcO+NwUs5OdNlgwilDCuCSzE+lvnTMuTA zfovzFVXeGKSn5kMuBCFn05zOY1xUsY+2wXEJEv3c5j2Ab4rJqhV6V7AzXe6Wy8KK/ UfRdAGVqkfqJ1BYrYIvAWODYkppDmMPQljaQt/hD4t8POlOORDq2MBqYDqBN+4rZXw ypXVznajnrOVFW4qVLjT7mepHoWOXpGvR4opjAVkn+j8XLSHUysFwf+uFMPl6Hl+J0 VLiEnzqFVxe91yRkXdqhD5q/VuO0D0e+gCeBbOVEfCYDztpn8sb+x003OG/jmg5N2M nRsYAteAzdceA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 458B680394; Mon, 6 Jan 2025 15:07:37 -0500 (EST) Original-Received: from pastel (69-165-162-104.dsl.teksavvy.com [69.165.162.104]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0751E12049E; Mon, 6 Jan 2025 15:07:36 -0500 (EST) In-Reply-To: <87plkzyh60.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 06 Jan 2025 19:40:39 +0200") 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:298694 Archived-At: > The main problem with empty opening and closing keywords is that > nodes from different levels all end up at the same position, > and currently treesit prefers a higher-level node. This means > that the sequence of `C-M-f C-M-b` is not idempotent anymore: > `C-M-b` might jump to the start of a higher-level node. It's never been idempotent, tho, e.g. in cases like: ;; Starting from before this comment ;; `C-M-f C-M-b` will end up after it. (hello world) or + x But indeed for list operations in indentation-based languages like Haskell/Python/Coffeescript/YAML, we're faced again with the fact that a closing LF can close several nested lists, so when going backward there is some amount of ambiguity (and I'd argue that it's preferable (and closer to the historical behavior) to choose to jump less far, e.g. so that `C-M-n C-M-p` never moves backward). > Also in treesit.el, forward-sexp and forward-list could share the > same implementation. [ I assume you mean "share *some* of the implementation", rather than being literally aliases of each other. ] Stefan