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: Mon, 06 Jan 2025 20:45:14 +0200 Message-ID: <86a5c36ath.fsf@gnu.org> 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> <87wmfwqg7e.fsf@mail.linkov.net> <8734i5fyv1.fsf@mail.linkov.net> <875xmumpzv.fsf@mail.linkov.net> <86ikqubdsd.fsf@gnu.org> <87wmf9912l.fsf@mail.linkov.net> <867c798lco.fsf@gnu.org> <871pxhp24e.fsf@mail.linkov.net> <86cyh16nq3.fsf@gnu.org> <87bjwjyg5f.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11092"; 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 Mon Jan 06 19:46:42 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 1tUs7d-0002jX-Kc for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Jan 2025 19:46:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUs74-00008u-9t; Mon, 06 Jan 2025 13:46:06 -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 1tUs71-00008d-7S for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 13:46: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 1tUs70-00048X-Ug for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 13:46:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=RoEPcco1Vk7aNGqkKp8Yn1uBmHuJ9BtYs3txatQtEyM=; b=m04WhnQonFIUWQycQRrYb3j3BTE0hG+9gsMgYDCHjQxQsaNnBTQEW6OK4J8y4LOpMD+71yPgk9CeijwSQgrof3K0oofUDvTp62q6pBQmjSO1L0xdBLKBGRlwx+OrdpwlP/1N4sLKdjaPdtV86b+fscXgLXxfoadsbDotljsZriBDZ5+qebiKCQvNP4lmnvcSUEvsMrLOgDDHR1d4KSZbvc8z5syekrp/JQwekneWZ6dC0NcAVYJZx9hAWry0qZHXWv3hv3/3/U1/7fTOEh2KSOFQCrPtJJJ4ShueN1Kzdz+LDRTJZ8F+lcZe59DO5+bg0oxD6bWq1yVezSBUWk555w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUs70-00047H-EX for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 13:46: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: Mon, 06 Jan 2025 18:46: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.173618914215784 (code B ref 73404); Mon, 06 Jan 2025 18:46:02 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 6 Jan 2025 18:45:42 +0000 Original-Received: from localhost ([127.0.0.1]:40070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUs6f-00046U-6j for submit@debbugs.gnu.org; Mon, 06 Jan 2025 13:45:41 -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 1tUs6c-000469-Bm for 73404@debbugs.gnu.org; Mon, 06 Jan 2025 13:45:39 -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 1tUs6V-00047B-9U; Mon, 06 Jan 2025 13:45:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=RoEPcco1Vk7aNGqkKp8Yn1uBmHuJ9BtYs3txatQtEyM=; b=eUsDoAqEzWuw tOj6uSYvR/k+AgLo8K4IhOSGaRX5iKem7ZvVP9ifgTmhiLExPcaiab/45jYnUN5GchDhj51mZgeKK RChXZcE39BHzvEvnJltwUcPDQEfc/6MjVJUFi/I9VoYhZueFMQtOjuiCGlmp46of6BLv91ks6y5bM GTaXBcyh4cOZF+duuCceuEBXgU9UZ69z2idOzhQLaMctNxL05DV1rgAVRLCJnqwH2zNIH3uUldpoB 74Bfb7MNxnhO6nCMyUdLCVyZuTG8+hcWmO7fNL+83TWXl8ZvnuB9YtCuZ/AA8PNSLamCH5chlPq9w WGnf7p1KdTFYj183zWdr1A==; In-Reply-To: <87bjwjyg5f.fsf@mail.linkov.net> (message from Juri Linkov on Mon, 06 Jan 2025 20:02:36 +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:298686 Archived-At: > From: Juri Linkov > Cc: casouri@gmail.com, theo@thornhill.no, mickey@masteringemacs.org, > 73404@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Mon, 06 Jan 2025 20:02:36 +0200 > > > Another example on line 152 in dispnew.c: > > > > struct redisplay_history > > { > > char trace[512 + 100]; > > }; > > > > Move point to the [ before 512: C-M-n will signal an error. > > > > Any bracket in the file will trigger either the first or the second > > behavior. > > Sorry, I didn't foresee that you would expect C-M-n and C-M-f to behave > the same way regarding list motion. This is fixed now by syncing > treesit-forward-list with treesit-forward-sexp-list, so all your > test cases work correctly now. Thanks. > >> > 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"? > >> > >> 'C-M-n' doesn't move to the next statement in c-mode, > >> since we need to support backward-compatibility. The key > >> that moves to the next statement ignoring nested lists > >> in C modes is 'M-e'. > > > > Well, then maybe we could have the more useful behavior as an opt-in > > option? > > Do you also need an option to move in Lisp from 1 to 2 in: > > (compound_statement > (if_statement > (compound_statement > (return_statement 1))) > (return_statement 2)) It sounds more useful to me than signaling an error, yes. > It would be nice if someone will find a way to modify the grammars > after importing them to Emacs core, to be able to insert more nodes. > This will solve a whole class of problems. Yes, an ability to modify the grammars and recompile them into the library would be great. > >> So you prefer "group" over "list"? > > > > As a shorthand; the better term is "parenthesized group". > > By definition a list is a parenthesized group. > The term "list" is much shorter than its synonym > "parenthesized group", so I see no reasons not to use "list". The problem with "list" is that it is not clear what it means in languages that are not Lisp-like. But we can keep that in the names of commands and variables, IMO.