From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mickey Petersen 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: Thu, 26 Sep 2024 16:21:33 +0100 Organization: Mastering Emacs Message-ID: <877cay1lqt.fsf@masteringemacs.org> References: <87plox4mtp.fsf@masteringemacs.org> <87frpm20t7.fsf@masteringemacs.org> <8634lmbs8t.fsf@gnu.org> <87bk0a1u0o.fsf@masteringemacs.org> <86tte2a5o3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="662"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e @VERSION@; emacs 30.0.50 Cc: casouri@gmail.com, 73404@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 26 17:25:52 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 1stqNM-000AZn-Gs for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Sep 2024 17:25:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stqN9-00047G-JW; Thu, 26 Sep 2024 11:25:39 -0400 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 1stqN8-000473-BG for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2024 11:25:38 -0400 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 1stqN4-0006OD-Ue for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2024 11:25:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:In-reply-to:Date:From:References:To:Subject; bh=c+wILEaEqETF5Gj/Tbu99sZvpIhUKhLsaGMsZWQQ0FA=; b=crWs8q4Bjw6sAzoKD/O5Ga3YPI6fa8Ybzu9NdgPnZGdr1AkKO5JywnPQz7ffcah9hcR6/EhSLBZu++QsVZBqzKtLtctc9yPYVVuqB7g66WYGYYJcXTQ6Z1bPxTvkJ3kFuwUpn+rD9JtY6f6dHivedKlG4rlq1/nPGVifmdbN4RAtvIi5FIrCkVgLxUzaULl/87OSBFoltcNfXaPYKVtofOaG3cxiA31sb9XlzBFA0FmldF/yX4UqRC2sxmIeAzMVVqQxcw2Tyw9pQwdcapkwNLFHmWlaLLxc4eEXcoUIuYdUJcRSM/7r524ZVzyjhqizymdvMDMISL8vniiE1gKkhQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stqNW-0008Kq-6F for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2024 11:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mickey Petersen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Sep 2024 15:26: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.172736430931419 (code B ref 73404); Thu, 26 Sep 2024 15:26:02 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 26 Sep 2024 15:25:09 +0000 Original-Received: from localhost ([127.0.0.1]:40043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stqMe-0008Ag-MN for submit@debbugs.gnu.org; Thu, 26 Sep 2024 11:25:09 -0400 Original-Received: from mail-ukwestazon11021102.outbound.protection.outlook.com ([52.101.100.102]:29421 helo=CWXP265CU009.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stqMb-00089w-Lj for 73404@debbugs.gnu.org; Thu, 26 Sep 2024 11:25:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=U86vlHcaZ3U9tulS1iowMsBXejps2Gqv2NHquXMTlSmL7wBNiO8v3F1FZ0Mkxb8xoRJRvyrj7BGrkt91Z6KQ6YwMCfQhiqmLNLJI7lVSHQ9l4VjtOep42c7HVjmaawWLV2p87mn5aZUBjuLW0+uz72zGAsM7oKgEf7v1rc3B81nx0JoyMX1hBUydzwHPNrJb2rVJfoKJZLqVdB2nS0ZFRm/CpvIGucPLT/80t7toT7tUpOL9OvZRN1P10k4e9IwpWKnkK1ixElIfF50iqHgZISoDAL72QX+9Eyuv4BlyM6C2qLud6fkyN4gMXZeGKV4TG+PfvBmrPFZzkbKkEHVgaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=c+wILEaEqETF5Gj/Tbu99sZvpIhUKhLsaGMsZWQQ0FA=; b=jyonaRSZG2/RixPqcXd+Doi/2LfqtmNtJzqiqBLgU00nmOYV2g3ON4tr3dJFWY4GCimnissuDlz0/3eKCDQPaU03N0Fx+hRtn0eQda+/YtSLmEmssxSGPXYgUZVzBuXN5r6T70YvXDX6Cl9nCArNDo0a0555rVLcbWbpoa2jU0M0TpDirpjeAeVYWjzERlg7eBSLUAdxNZL0eCdeNaXi4Hqp7ypfrrGBPlijk6UXel46FpCOWpRBQm9tcMfSDEzdixLiggXxaYF8ryZpexmoCH4XtCVinsEnttZQWf7xcZhvIYf8Xpgl8plZQq0Pj2jSd5bY1KBoxN7vkn0DgQZ3mQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 178.79.136.144) smtp.rcpttodomain=debbugs.gnu.org smtp.mailfrom=masteringemacs.org; dmarc=pass (p=none sp=none pct=100) action=none header.from=masteringemacs.org; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semantical.onmicrosoft.com; s=selector1-semantical-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c+wILEaEqETF5Gj/Tbu99sZvpIhUKhLsaGMsZWQQ0FA=; b=eh1XVUYGHzhyF4qrLrRr0M+18KLC57T6SD6QvS+V9Z/NR9rA1+/vYC23ml+yS9q8skHs/6HQG1jAt0aZSusfnG355Ua8dcsHWeQ5pjvhIFHV7c2jfxwXuRCb7f4TtHh9ayMnuOaPP85aX6XczNUaxnJWux4xHYUpvo54BNWG6YQ= Original-Received: from LO4P123CA0053.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::22) by LO7P265MB7938.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:40f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.27; Thu, 26 Sep 2024 15:24:30 +0000 Original-Received: from LO1PEPF000022FE.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:152:cafe::62) by LO4P123CA0053.outlook.office365.com (2603:10a6:600:152::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.21 via Frontend Transport; Thu, 26 Sep 2024 15:24:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 178.79.136.144) smtp.mailfrom=masteringemacs.org; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=masteringemacs.org; Received-SPF: Pass (protection.outlook.com: domain of masteringemacs.org designates 178.79.136.144 as permitted sender) receiver=protection.outlook.com; client-ip=178.79.136.144; helo=semantical.co.uk; pr=C Original-Received: from semantical.co.uk (178.79.136.144) by LO1PEPF000022FE.mail.protection.outlook.com (10.167.240.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.15 via Frontend Transport; Thu, 26 Sep 2024 15:24:30 +0000 Original-Received: by semantical.co.uk (Postfix, from userid 5001) id 1D47F114002; Thu, 26 Sep 2024 16:24:30 +0100 (BST) In-reply-to: <86tte2a5o3.fsf@gnu.org> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO1PEPF000022FE:EE_|LO7P265MB7938:EE_ X-MS-Office365-Filtering-Correlation-Id: 84322977-2a1d-49e3-fe0d-08dcde3f50fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|61400799027|376014|82310400026|79816003|14776008; X-Microsoft-Antispam-Message-Info: FJnCto/CjphgZWH90GzTeDyU64W+E8JLwCvc7vI/vRIiztUColWxcYTFSpyrreZI323ip+RrXhWTS8lVmY196jxfIncQPB5eDHZwYvLZ8n4Ym5pY74/n4Ohzl0SIQV32/NC/zXdqiPNuCGUAj1IxH60dmqyD6IquZv6Ck2cWJmdHR1j6GxGLRlUcAUAAj8kMLjZ+0NIUHa7eZd16hq9naaq93u+0kQTXsYi4MIZKC58/NO8NdlZydaSThslm/C1zkSepR0DD572vdB4h6tcOS88SCSFFsLq9NppW2RBA7i1F3lIBBoE9ub66rGv5vG1H7SbODGKnwQP79pOKvZn1eOfIBU6Ho6/QzNz39QgKOC65ilt1zw3gPLcYbRo87oE1jxXeqzzscKDuMnCyLhaJbbUfv++pW3h9komGNHjoOMF4BsMpTMPNXlH2STYh2VWuoRQOBCQZuAzg3xVb/LU1QNbkxIH+Tecdvk8EiUqXxvhOGG905aqj6MwiC4ED0jpfvuL3V8o30MCF/9OKtKIXeA6xGa58cUddzJ7vVBsbtPGjv4AqzoaQ3cmqwQKHVmVovZ9xiNsqZalRkJFQHt1k/XTze4WQVZODwRQ7RclSmKXwCWr2mLGRVaQF599IOwd/CyiaLsSIF3KHam+uh0tLq6V/nnmuWP4LoyJ61pOvNqM8Bny1rONd8PNr78Z5XYtU1VS551D85cmo5fB95mgjVsyqD1DgJd5+51p5lg0uqLwRiOA0ia6sWFj6UnKWc JYwYgrqH1v4QEsHl/fG8488qub3Fd1pbqNmzvKGiOddPX4KXDYFk+dcoa7jZXTR2W5Wby0IBz8sI5x/b+kDCsIbWVyd/7PH/vf X-Forefront-Antispam-Report: CIP:178.79.136.144; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:semantical.co.uk; PTR:semantical.co.uk; CAT:NONE; SFS:(13230040)(36860700013)(61400799027)(376014)(82310400026)(79816003)(14776008); DIR:OUT; SFP:1102; X-OriginatorOrg: masteringemacs.org X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2024 15:24:30.2493 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84322977-2a1d-49e3-fe0d-08dcde3f50fe X-MS-Exchange-CrossTenant-Id: a4e27e3d-bab0-45e8-8942-e64cf9fbd34f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a4e27e3d-bab0-45e8-8942-e64cf9fbd34f; Ip=[178.79.136.144]; Helo=[semantical.co.uk] X-MS-Exchange-CrossTenant-AuthSource: LO1PEPF000022FE.GBRP265.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO7P265MB7938 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:292471 Archived-At: Eli Zaretskii writes: >> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_RECEIVED, >> NO_RELAYS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no >> version=3.4.2 >> From: Mickey Petersen >> Cc: casouri@gmail.com, 73404@debbugs.gnu.org >> Date: Thu, 26 Sep 2024 13:13:53 +0100 >> >> >> Eli Zaretskii writes: >> >> > int foo = bar + 2 * baz; >> > >> > Suppose you start with point at "foo": what would you expect >> > forward-sexp to do? nothing? >> > >> >> I expect it to behave as it presently does: default to word-like >> behaviour such as M-@ / M-f etc. > > Then we just lost an opportunity to have more useful commands, because > we already have M-f and M-@. > >> Balanced expression is not well defined, de jure, but it is in >> practical terms, making it de facto rather well understood and >> supported. It behaves reasonably consistently across languages, and I >> use *-sexp commands thousands of times a day in a wide range of major modes and >> contexts, both in code and also prose. > > I think the ability to move by parse sub-trees is also very useful. > Agreed. What matters is whether the crop of new sexp commands, such as they are, perform satisfactorily. Do you think the examples I listed in the original bug report match your expectations? If so, then it is probably OK to close the bug report. >> Most people who use *-sexp (or *-word commands for that matter) in >> major modes come to recognise how they work and know what happens to >> the text/point in their buffer before they run them. >> >> I would challenge anyone, given even small samples of code, to do the >> same with the current TS only implementation. > > That's just a matter of getting used to the new semantics. > >> > I disagree. Moving by sub-trees is a natural generalization of sexp >> > movement for languages where parentheses and braces are rare and far >> > in-between. >> >> Yes, if one can intuit the sub trees' structure, which is not so >> simple; and if the selection of commands are sufficiently expressive >> enough to let you navigate the tree. I am not sure they are. > > There are enough situations where moving by words will also surprise > you. For example, did you know that M-f stops when it finds a > character from a different script? And yet we still use these > commands.