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: Fri, 13 Dec 2024 09:06:04 +0200 Organization: LINKOV.NET Message-ID: <87zfl083rn.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> <5192B278-66C0-48AE-B881-E57CCBB6B501@gmail.com> <87frmtbc9z.fsf@mail.linkov.net> <86bjxh1h86.fsf@gnu.org> <87y10l8h6k.fsf@mail.linkov.net> <87ldwl8g60.fsf@mail.linkov.net> <87wmg53rdj.fsf@mail.linkov.net> <87a5d0n651.fsf@mail.linkov.net> <865xnozpdo.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20149"; 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: mickey@masteringemacs.org, casouri@gmail.com, theo@thornhill.no, monnier@iro.umontreal.ca, 73404@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 13 08:11:39 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 1tLzpq-00056P-J0 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Dec 2024 08:11:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLzpL-0001GL-DL; Fri, 13 Dec 2024 02:11:07 -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 1tLzpH-00013f-Kh for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 02:11: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 1tLzpH-0007KT-AI for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 02:11: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=L+bVUl/SS7spjPvP9X/1e7XGkgZYzTWvixsEsNlCl5g=; b=FaPuB72KyaMgNrLIexHM63VD4CDf8dQnWVNxdNYdx7RTYxj/jMyhadEMpBLQprI+nqLOwtY7B00gzft/wTeYio97YwOybx3h6TiQIWctWQSHebTwOsM7aAvler5ITtsbVvA/IDtIfORjOtjkslNoHOUNsVait+6XhZJmeAuhm7O5pQXtnnWxyQrosMMtQNi8JrRUwzoAM2Mnm4Lbnb2TXP5dmX7KPuTrJ8jGTL13JQfd55BLyxdK6TApH5tCaa3sPJTvnhlslVJ/wbN0f1D58w6d+sPEZAQ0lALcrur/tNvwuzWu1QkEZxqG/YOxo8ARSLbAn+UO7TebL5aGf23Csw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLzpG-00058Y-1E for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 02:11: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: Fri, 13 Dec 2024 07:11: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.173407382419679 (code B ref 73404); Fri, 13 Dec 2024 07:11:01 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 13 Dec 2024 07:10:24 +0000 Original-Received: from localhost ([127.0.0.1]:41347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLzoe-00057J-5K for submit@debbugs.gnu.org; Fri, 13 Dec 2024 02:10:24 -0500 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:59881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLzoc-000574-1m for 73404@debbugs.gnu.org; Fri, 13 Dec 2024 02:10:22 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 7995260006; Fri, 13 Dec 2024 07:10:12 +0000 (UTC) In-Reply-To: <865xnozpdo.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 12 Dec 2024 21:13:07 +0200") 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:296958 Archived-At: >> This patch keep the current function treesit-forward-sexp, >> and creates a new function treesit-forward-sexp-list >> that uses the 'sexp-list' thing to navigate lists while >> using forward-sexp-default-function to navigate atoms: > > Introducing a new command raises the question how should users > navigate using the two. Will C-M- invoke forward-sexp or the > new command (or maybe one or the other in some dwin-ish way)? > > What are the problems with teaching treesit-forward-sexp do what the > new command does? IOW, why do we need a new command? Actually, it's not a new command, but a new function for C-M- via forward-sexp-function. This is from treesit-major-mode-setup: (when (treesit-thing-defined-p 'sexp nil) (setq-local forward-sexp-function #'treesit-forward-sexp) (setq-local transpose-sexps-function #'treesit-transpose-sexps)) (when (treesit-thing-defined-p 'sexp-list nil) (setq-local forward-sexp-function #'treesit-forward-sexp-list)) When a ts-mode defines the 'sexp-list' thing, only then it's used. Otherwise the current implementation with 'sexp' is used for C-M-.