From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill 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: Sun, 05 Jan 2025 13:30:31 +0100 Message-ID: <874j2dv3x4.fsf@thornhill.no> References: <87plox4mtp.fsf@masteringemacs.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> <86cyh18nee.fsf@gnu.org> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35803"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, mickey@masteringemacs.org, 73404@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 13:31:21 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 1tUPmr-00097j-6x for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 13:31:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUPme-0004M7-Ia; Sun, 05 Jan 2025 07:31:08 -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 1tUPmY-0004Ls-UT for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 07:31: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 1tUPmY-0006B5-MK for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 07:31: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=u+CF+m6p29qajvaIzzYv5vtx/udeV3SaxZ2CJRLfWi8=; b=FM28B93U/8FxX/usjD7PwaC22qRSD1aaDcI5xZX04hpfxk4GLyqZzzSCdEf9GZYoyOezqrdfZlNlEKE6OT0W1/7prZHS8UNaw6+lJtLPr/f5l9UHkoIanaI5KxxKgN2OVBikCv+ZVukRFVRM7n2gU5sp7LKDyEkjXxj5hIx5Z2XaDxRWv7huP9G0Z350tYSXox48oSZyG+7kssppmqjK/kNmBhF8eUZAmHA4oD7N4QM7u3eAj9PXJasQcj7A6eY/btYpm6EC/5WVJ3jX5htuRrQac2zdZfHbUpRUlK3heEWoNgfGlnkxv4bhbyDSpBm0hHp/aJ3B90JBPP71nTScfw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUPmY-0008Sh-GH for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 07:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jan 2025 12:31: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.173608024932504 (code B ref 73404); Sun, 05 Jan 2025 12:31:02 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 5 Jan 2025 12:30:49 +0000 Original-Received: from localhost ([127.0.0.1]:60277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUPmK-0008SB-AK for submit@debbugs.gnu.org; Sun, 05 Jan 2025 07:30:48 -0500 Original-Received: from mx.kolabnow.com ([212.103.80.154]:60074) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUPmG-0008Ro-SX for 73404@debbugs.gnu.org; Sun, 05 Jan 2025 07:30:46 -0500 Original-Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 8FE9D3004C6E; Sun, 5 Jan 2025 13:30:38 +0100 (CET) Authentication-Results: ext-mx-out013.mykolab.com (amavis); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-type:content-type:mime-version:message-id:date:date :references:in-reply-to:subject:subject:from:from:received :received:received; s=dkim20240523; t=1736080236; x=1737894637; bh=u+CF+m6p29qajvaIzzYv5vtx/udeV3SaxZ2CJRLfWi8=; b=P6lUaS423m9o szrup0WDtYJiH6W4LktiktIzaBYjnNRwCtyZ4nSSi68qj/L6Z3NKbtnYKxRa+knv CfNoV1BpywXzSGJhmZz+GXA18nManc5U1qH8sY0txDdaKzETVhzdiH+NHKSQYpGC czFEH4r2uVTLL4t5su2KqskmGEmEb4ny337rHVXUj0U5IlymZ+f3Tw5xjt6u/HEP GWbOoN2dDimSaOTKORkRJZ/7/rMgkUKdNlQOGHsCpWXmb/TA05onjtVjIwTNZG2Z nY6iOkH9YuCh+uGmlK5pvetUaV2BfYQTt2YgKgJ+ARrTJNqbeddxp4aAzKMYehS9 bU4wwJonnQ== X-Virus-Scanned: amavis at mykolab.com Original-Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out013.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id wBUqGKpmYrQ0; Sun, 5 Jan 2025 13:30:36 +0100 (CET) Original-Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id 309583004C6B; Sun, 5 Jan 2025 13:30:32 +0100 (CET) Original-Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id CC54A2125AB9; Sun, 5 Jan 2025 13:30:32 +0100 (CET) In-Reply-To: <86cyh18nee.fsf@gnu.org> 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:298554 Archived-At: Eli Zaretskii writes: >> X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1] >> autolearn=ham autolearn_force=no >> From: Theodor Thornhill >> Cc: casouri@gmail.com, mickey@masteringemacs.org, 73404@debbugs.gnu.org, >> monnier@iro.umontreal.ca >> Date: Sun, 05 Jan 2025 12:46:03 +0100 >> >> Juri Linkov writes: >> >> > 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. 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. > > Is this goal achievable in practice,l given the sometimes radical > differences between languages? Maybe we only can have examples and > some dwim-ish behavior in most cases? I'm not sure if it is achievable or not, but I think it'd be nice to avoid any "hand-waviness" to confuse us while we talk about sexps/lists/etc. I could try to document thoroughly how lisp-modes and cc modes implement these and see if we have some glaring discrepancies between just those two? I'm just thinking that describing the as-is could be very beneficial, so that we know we're talking the same abstractions. It could start just as a scratch/movements.org file, not touching any code until you, stefan and others agree that we're talking about the same stuff. Then we can at least consult this document when we stumble upon things like jsx-text, whitespace etc. After this we can proceed with mickey's combobulate and friends to inform us on what the best way to deal with it is? Maybe we can discover som simplifications in core too. WDYT? Theo