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 12:46:03 +0100 Message-ID: <87a5c5v5z8.fsf@thornhill.no> References: <87plox4mtp.fsf@masteringemacs.org> <87frpm20t7.fsf@masteringemacs.org> <8634lmbs8t.fsf@gnu.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> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2786"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, mickey@masteringemacs.org, 73404@debbugs.gnu.org, monnier@iro.umontreal.ca To: Juri Linkov , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 12:47:28 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 1tUP6N-0000ZX-C8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 12:47:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUP63-00054T-0f; Sun, 05 Jan 2025 06:47: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 1tUP5z-00054J-4V for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 06:47: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 1tUP5y-0000wa-JD for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 06:47: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=A766Puq6PPrgBCLIKKkvjppzC+Xmxqwz7I1fEoHFdYY=; b=XTCW9aCYkoH8njEaTkTja3Knfv5tci0+lozBSKBhGEP6TSol0dPKjsJnVdN4kPlua0IgltH/QOtaLi/ARqJa5iJBj/DfZ9FzYRRAehiG74A95hfhuGDpsSg2JcnxGov71i3TJXCjQxq/s3VtUWuZxKd5cUHJ9jZ99pAltuz0wTp+HTs+tiAMkLJo2o5l7+fRz4bXm8XFV192PG6v3MM9ViIbCKSK4k6C8qukvDZ5WZMQCIXscs/nAdDRyhjH3oJIehWqv2ZG/0Pp9qpGIRkoUZrxbO5aDN3yV6kR4KTYkVMdH6cPU7gciWqMyUVGnfVHrl8+BsCK2bCMiWetLH7fLQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUP5y-0005xn-9j for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 06:47: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 11:47: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.173607757622811 (code B ref 73404); Sun, 05 Jan 2025 11:47:02 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 5 Jan 2025 11:46:16 +0000 Original-Received: from localhost ([127.0.0.1]:60190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUP5E-0005vr-4G for submit@debbugs.gnu.org; Sun, 05 Jan 2025 06:46:16 -0500 Original-Received: from mx.kolabnow.com ([212.103.80.154]:58552) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUP5B-0005vV-Tr for 73404@debbugs.gnu.org; Sun, 05 Jan 2025 06:46:14 -0500 Original-Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id E8030209201D; Sun, 5 Jan 2025 12:46:07 +0100 (CET) Authentication-Results: ext-mx-out011.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-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:references:in-reply-to:subject:subject :from:from:received:received:received; s=dkim20240523; t= 1736077567; x=1737891968; bh=A766Puq6PPrgBCLIKKkvjppzC+Xmxqwz7I1 fEoHFdYY=; b=ooSrn0MuzQpEEGXGdaMoKJO119nOEP/NSa+fcvZfhnOqEhSQD++ UZEnkgxfmddsqmub7cjnvPt8xKE5smIbsxctbgApGqZMGfyNzDpPSoyUgw7raalC Fl31fMxj1sJ9+CYNBVnKNoo7tQXeZz+BauQTWwyfecIY1MafS5s9HgnSK8uLC3ag PyJr2U6V/HfeufOKblLn+hLNFaBkmtAjw5l6oHrR/laHIfgmBGthG56eJBXlFC7M XuAMFr/48KodGbqGqYUyI4s6CqGuHDx44GFcyqC5NC47GqhL8AYNxf4G6NOVZugn t1xzTo8m59fPgLM6YkJpD7pyLmfpO8hS4PQ== X-Virus-Scanned: amavis at mykolab.com Original-Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out011.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id wfrrco_IP5xs; Sun, 5 Jan 2025 12:46:07 +0100 (CET) Original-Received: from int-mx011.mykolab.com (unknown [10.9.13.11]) by mx.kolabnow.com (Postfix) with ESMTPS id 07EC22092013; Sun, 5 Jan 2025 12:46:04 +0100 (CET) Original-Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx011.mykolab.com (Postfix) with ESMTPS id B36A3313E1FF; Sun, 5 Jan 2025 12:46:04 +0100 (CET) In-Reply-To: <87wmf9912l.fsf@mail.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:298547 Archived-At: Juri Linkov writes: >>> >> BTW, my initial intention was to add the thing 'list'. >>> >> But then I discovered that (treesit-thing-next (point) 'list) >>> >> uses the function 'list' instead of the thing 'list'. >>> >>=20 >>> >> However, the current 'sexp-list' as a two-word composite is too ugly. >>> >> Now I found a better replacement: 'group'. This word is already used >>> >> in lisp.el such as in the docstring of 'forward-list': >>> > >>> > I don=E2=80=99t have an opinion on this. Groups sounds a bit abstrac= t, but so >>> > does sexp-list. >>>=20 >>> Indeed, the right name is 'list'. So let's use it. >> >> Please don't change the terminology yet. > > This doesn't change the terminology. The ugly name was added a week ago. > We need to fix it to the right name. The right name is 'list' to > conform to the function name 'forward-list'. > >> I'd like to try these commands with some tree-sitter modes and see >> what names we could use for them. > > 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.