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: Sun, 05 Jan 2025 15:02:31 +0200 Message-ID: <867c798lco.fsf@gnu.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26357"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mickey@masteringemacs.org, casouri@gmail.com, theo@thornhill.no, 73404@debbugs.gnu.org, monnier@iro.umontreal.ca To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 14:03:30 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 1tUQHx-0006iP-QC for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 14:03:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUQHY-0008Sh-6I; Sun, 05 Jan 2025 08:03:04 -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 1tUQHX-0008SS-33 for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 08:03: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 1tUQHW-0004vP-Pw for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 08:03: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:References:In-Reply-To:From:Date:To:Subject; bh=jsx5MiHaYUlnwSxBl5CAhKbvXg+d5qUSdQPUbLKK5jA=; b=o0aUC12vYvyZ58LD/d6x4Zp4XozmC1oa7p7oARKrRQIBOmAxna7w6iKI2sflNTgBNmeqKa4/rHkW4I0Y+gq2XybzbppDIvqqeqBzTdEQrJJC4yDSZJrWEk7DRczmglsfSdwGdkJeIAA0X1vxqdwh9VYj+nU6HtPSC+sXo3/wmVuC44kygpTESCRIVQHEN3yE6N4Qr6tdAMaxxqtgOPyx1z7//FYsIFcm5b3DqkzEDCPAgJC4UFtobDNCYxcRHxRpGKjTrVLKcMY91c2+LRYRkLzjumRNUn58WkNlU/d+eED4T8ppCs+c5hilE6q+gHb6iN3WUCb3BHdnyfou/ZtRBQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUQHW-0001h0-4k for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 08:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jan 2025 13:03: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.17360821686476 (code B ref 73404); Sun, 05 Jan 2025 13:03:02 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 5 Jan 2025 13:02:48 +0000 Original-Received: from localhost ([127.0.0.1]:60329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUQHF-0001gI-7z for submit@debbugs.gnu.org; Sun, 05 Jan 2025 08:02:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34692) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUQHC-0001g5-Kc for 73404@debbugs.gnu.org; Sun, 05 Jan 2025 08:02:43 -0500 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 1tUQH5-0004sP-4u; Sun, 05 Jan 2025 08:02:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=jsx5MiHaYUlnwSxBl5CAhKbvXg+d5qUSdQPUbLKK5jA=; b=Qt36DPRxvTiZgQM8J08t RQUXNlCafRDZZR3sPGPmZvLu2R890EAIgwRvk7CVPaBOfHZ4Q/IuPsppc1S/03jkm6ghzBB2XrBU7 Eoxc9jaDYfNu/buLYq9FbyQHyaIBBvr9aVgHDEH//q57NhDRSyPs3qLbcJJdytwdks/MczwFsm4rD WWQPiwj0xneNYzJsYI6EAwGQv4RthIIyt5des/vO7J9pK3nIv084w45/XtWkY2xk4Jtq0tkejzXJK D3Wj6yR1VevcnyXYTlErsXMyXhjoDRLunortnDCRpqRaTwWF6/wPX2ziQuKjtNKV30KOPvP4GOy9e zOshL70U/e+jug==; In-Reply-To: <87wmf9912l.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 05 Jan 2025 09:32:58 +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:298558 Archived-At: > From: Juri Linkov > Cc: casouri@gmail.com, theo@thornhill.no, mickey@masteringemacs.org, > 73404@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Sun, 05 Jan 2025 09:32:58 +0200 > > >> >> 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'. > >> >> > >> >> 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’t have an opinion on this. Groups sounds a bit abstract, but so > >> > does sexp-list. > >> > >> 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. Thanks. I tried this now in c-ts-mode, and it seems to behave strangely in some cases. First, AFAICT it supports "lists" enclosed in "(..)", "{..}" and "<..>", but not "[..]". Is that expected? Why don't we support "[..]"? Next, it many times signals an error "No next group", which is less useful than it could be. For example: w32_get_internal_run_time (void) { if (get_process_times_fn) { FILETIME create, exit, kernel, user; HANDLE proc = GetCurrentProcess (); if ((*get_process_times_fn) (proc, &create, &exit, &kernel, &user)) { return ltime (total.QuadPart); } ^ } return Fcurrent_time (); } If you put point on the semi-colon marked by "^", C-M-n signals an error. Can't we instead move to the next "list" after "Fcurrent_time"? Also, it sometimes "misses" what looks like a "list". For example: s_pfn_Open_Process_Token = (OpenProcessToken_Proc) get_proc_addr (hm_advapi32, "OpenProcessToken"); If you put point at the beginning of the line, C-M-n moves to the end of the 2nd parenthesized group, not to the end of the first group. As for terminology: the Emacs user manual calls these "groupings delimited by parentheses (or whatever else serves as delimiters in the language you are working with)", or in short "parenthetical group". Why cannot we keep this terminology? It sounds like it describes its subject as accurate as we can come up with.