From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier 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: Wed, 25 Dec 2024 14:29:19 -0500 Message-ID: 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> <87ikr8hpdu.fsf@mail.linkov.net> <87y103wsji.fsf@mail.linkov.net> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31200"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Mickey Petersen , Yuan Fu , Theodor Thornhill , Eli Zaretskii , 73404@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 25 20:30:25 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 1tQX5M-0007uz-Mi for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Dec 2024 20:30:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQX52-0002rH-Da; Wed, 25 Dec 2024 14:30: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 1tQX50-0002pZ-VA for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 14:30: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 1tQX50-0001KW-MU for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 14:30: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=xPHMcXPCo7kAURsogqIS9WXsgS+WJk7B9nwZX49cwgw=; b=CeTbyZi2DO829ubbwpP1xWPxotbgzM3VyA46Ih1HAYo8UdQ3Zu9YH8/jg0/DxjOCwGRQR8yu02U7bEUaypQZ42HJZqozvMmYOj+doqV0Wy2dIkWSwhsC3qyLkb2uW1PCIdwDWo+1ReWh/BhuH+Yrv2ROWyZu+FiksNc9rS0KCwBjWHxshD8M8CXjZ7SYjUQzUniMYbW72v6N93gBjJLtAYMJainviyCW6mQk6RVBYTBiRjARvcgrtPl39Ft9XqLGm9MPgy3lfnUPcXVfCn5HYjmWCbk7EifO7yIpgu0yCTAqDaKBgruL/CCSyUpKNfQWgJGIF/5Jr4Rlyse2DZm5Eg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQX50-0004No-IG for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 14:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Dec 2024 19:30: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.173515497116782 (code B ref 73404); Wed, 25 Dec 2024 19:30:02 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 25 Dec 2024 19:29:31 +0000 Original-Received: from localhost ([127.0.0.1]:38844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQX4V-0004Mb-Am for submit@debbugs.gnu.org; Wed, 25 Dec 2024 14:29:31 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQX4S-0004MJ-QT for 73404@debbugs.gnu.org; Wed, 25 Dec 2024 14:29:29 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C3FA34408FA; Wed, 25 Dec 2024 14:29:21 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1735154960; bh=qVTLt6f7V97XUnnEdIXPtH3CvYYP2fUYKQX2ByX6nBA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iCUVJF1TXrQcQm6FBBajGQ7JqcR6yina10/XoWbCcUiov8CRFggeeqK/xxRcpqeqi w+ks3f6NhiJ9bmsCXMYWe6dNBJqnG/lHNT1PWJFC5Tb8Cf7sKeW7Bi4wpEBDrEMOix 7hD4ZPRpa/rhgqO8wj5No0+PPYYj+Q5i3Em1JnbDNXGRVrIQRgnZ/W/D6VHwyt7ZRk qgv1AVq8evMPPv0eCPTNSo9gggnEy7aH5oKUQ3SaEs6vQuZHj/RwJ0Mm79a105cKbX zWR/F5aJ1sYcZD+dCj5HbB8BahcxN8ehNOJd0FUc9+IG6FrWOKJV6eB6Os+vXo7qRP +2+qcw5DRWeZA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C3C01440096; Wed, 25 Dec 2024 14:29:20 -0500 (EST) Original-Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4D28C120422; Wed, 25 Dec 2024 14:29:20 -0500 (EST) In-Reply-To: <87y103wsji.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 25 Dec 2024 20:01:37 +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:297738 Archived-At: >> Gentle reminder that `forward-sexp` is not a "list-navigation" function. >> That would be `forward-list`. We very often use sexp commands and >> functions to manipulate non-lists such as identifiers. > Do you think it would be better to override low-level functions 'scan-lists' > and 'scan-sexps' with new variables like 'scan-lists-function' > and 'scan-sexps-function', instead of adding more variables for > overriding top-level commands such as a new variable 'forward-list-function' > and 'down-list-function', like the existing 'forward-sexp-function'? Don't know. What I do know is that in general we'd also want an `up-sexp` operation. Currently we have an ugly kludge in `up-list` to try and use `forward-sexp-function` (which is ugly both because `forward-sexp-function` doesn't really provide the functionality we need, and because it mixes up sexp and list navigation), and it would be good to clean it up. AFAIK `up-list` is the only place where I've needed sexp-based navigation and where `forward-sexp-function` didn't do the job. In theory I guess `down-list` is another, but I've never found a use for it. Stefan