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#60655: 30.0.50; tree-sitter: `treesit-transpose-sexps' is broken. Date: Sun, 08 Jan 2023 10:53:33 +0000 Message-ID: <87r0w5jo0i.fsf@masteringemacs.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="27521"; mail-complaints-to="usenet@ciao.gmane.io" To: 60655@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 08 11:54:10 2023 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 1pETJZ-0006wP-Vk for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Jan 2023 11:54:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pETJU-0004fV-5O; Sun, 08 Jan 2023 05:54: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 1pETJS-0004f9-7o for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 05:54:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pETJR-0006Cr-W1 for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 05:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pETJR-00042o-NL for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 05:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mickey Petersen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jan 2023 10:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60655 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167317522815521 (code B ref -1); Sun, 08 Jan 2023 10:54:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Jan 2023 10:53:48 +0000 Original-Received: from localhost ([127.0.0.1]:59993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pETJE-00042H-8b for submit@debbugs.gnu.org; Sun, 08 Jan 2023 05:53:48 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:53070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pETJC-000429-BN for submit@debbugs.gnu.org; Sun, 08 Jan 2023 05:53:46 -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 1pETJC-0004e2-33 for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 05:53:46 -0500 Original-Received: from mail-cwlgbr01on2139.outbound.protection.outlook.com ([40.107.11.139] helo=GBR01-CWL-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pETJ6-00069r-J1 for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 05:53:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hj427ztQXYm+xTU81o0GJFSv4C1qz2G8JzirI7o+F0iB7RYhPIMQ8HLcUvIJUVpowbaegqud1PjfPjJ7oS+EM6ysFRgIwdGUuZ77AfYjhQYHscRgQ7HpPK12QFCNNowFD2+fz+wbABL1l7sY0h6GNTntthjOvNqzPUyCIMZvRj0JjHLIGzroPHCs6q8U7y4wU+JGzHat0FxTHXC6WbbquGI2IUr0Zanm88dWulI/GlFdo99/EKPKkMPLRHmttPQnECFAXBLmBWcDiHm71RNIX377swh/ycmhKPYchaVJ2ZAkkj764zqFKrmkMs2gkjJb94mDlYhTtGEzD/qLnyQhKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ZZ+8dUst+aCSYYu26M8+ezdzwj7AFIoMoWq7Yk0rxM0=; b=bhL2fvfBNvfNQDlh8EcidR7570VcjJWD46CFcGs+9lJeOoHkb4GoV2OHSFzK/6oMt1A/0Kns/AT+4Dd8r1FgWZvag/XDifJZbmpFD8F9zMK9KP3Lm5Ex3ej+MWDhXc3F5nuXDU9BLBXKdVNITrfDD8lAfXWqKA4yv5vYmEJMhrPqtYqxpt34pRn4b9VVheBWA5lxpa8kGiAwymed8Dpsr1EWVOoEs4l3RcIqUeOPLVz9rP2h7Sq5Qn4lHQoBU9eUZW/1cEgNYQM3umPj+Q7L/9ssnlzEc/4WDTUryqMFF6RUDur8Gjzq5FhL15CmkXbIRyxa/g2hITLFkRnZFSVJ0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 178.79.136.144) smtp.rcpttodomain=gnu.org smtp.mailfrom=masteringemacs.org; dmarc=pass (p=none sp=none pct=100) action=none header.from=masteringemacs.org; dkim=pass (signature was verified) header.d=masteringemacs.org; arc=none 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=ZZ+8dUst+aCSYYu26M8+ezdzwj7AFIoMoWq7Yk0rxM0=; b=bDqTFmhfM+8RiNUfFCl+TzEEYGeowD5b8DFxFPYqdxDTmosTMQz0g98fHWm3RkQjPVz1f8xMgVzE4UCDzrghattycl/jv+nX+L449qALZWskfsnMfoOoHeAeBOOn0eo1DlhCRoY/GC68iqYyF0Lawmef/YZn2ycT1L7P16Tjb9A= Original-Received: from LO6P123CA0025.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:313::18) by LO4P265MB6252.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:27f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Sun, 8 Jan 2023 10:53:36 +0000 Original-Received: from CWLGBR01FT035.eop-gbr01.prod.protection.outlook.com (2603:10a6:600:313:cafe::ab) by LO6P123CA0025.outlook.office365.com (2603:10a6:600:313::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Sun, 8 Jan 2023 10:53:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 178.79.136.144) smtp.mailfrom=masteringemacs.org; dkim=pass (signature was verified) header.d=masteringemacs.org;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 CWLGBR01FT035.mail.protection.outlook.com (10.152.40.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5966.17 via Frontend Transport; Sun, 8 Jan 2023 10:53:36 +0000 Original-Received: by semantical.co.uk (Postfix, from userid 5001) id 99D8D114002; Sun, 8 Jan 2023 10:53:35 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=masteringemacs.org; s=masteringemacs.org; t=1673175215; bh=JLQXXjFESZWQRpsB0zslI5WMkKM+85yk5SAcHgyDWqQ=; h=From:To:Subject:Date:From; b=ICoxkyrCMVewo2DANb7o+SNVfKIg1VOstEjc5s5cYOoBTI3xCTxeFvohjOlJtrpeE U8++ZburjzJLxWuJXzCnQDgmKIKGB8HWMMWzQ8Ygzt4xDCXsgFv1xd469w+2lGbIxa pQh5w5mHgQPgaxbI/+rA5n0OPuXQ2hj6+ccQFd0E= X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CWLGBR01FT035:EE_|LO4P265MB6252:EE_ X-MS-Office365-Filtering-Correlation-Id: c3532b31-297f-48ae-4688-08daf16697b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9vwaoH2VDmltd4hzl6F0A05dvKGXFo97fAPQ7BTyIjDpq7UBbU1R2bS+DQU201nxMjtIiRaWCMDBC+Olq2jYe/C3uGC9xy6BLynnx8TudSfVsb8QD1Pt/D5sGmjZGElm3OYRUP21tDYUmZMAkog9qYDQ9NwHYdLSoKfywGrJH/rTvexE1b12cBbWxTk1/ydR2A4+ihGA5WUWhs7iPMikqRRU+yE+6ETu3vWqYGEIN5+LkXqYigMnaxsg+9KCJhRX1KIemSEqGoHUwi1qv4u2mfIosqPfROOvSmqiaWxGgWo9GSRDNosUXWmZGNTtaTaByUqu7SMoESMIakTXlpr+tVJTEdA5FBXep6qSjs9REXil50vJrTBySpiAKmJnFtpOuXeaOPeClh5Wug9s6FMcJXPRacEB1XwoiDMGPy3dzT8+PD3LC9W9iq8wUViJJ07W5maxK4t2QlKcbexKX/PvvRbxZkIRfHWaeuEcC5ksDYZPKxwQBa+2yE10LacS8ZN8O3Z95J234W/1vy6llShikPnhCIi3ZXmGIAUGoFnUSlaQt4QDRZNv/PXjgxt/6wbyxhAstdVM7vg8vRiHG0CwjarYzeWFlEVXalxj47qt6pJFzpsl8YH4weERNeKSuYHnur8vMsA4j9OIDgi3cu1fQ6RoKmn9bUjGuFraIp90hGE7H7R+LdzVePmuzFzzyzGBz4qWjVGJHgtyQ9E4At3nQ+KkXT7gOV+eds10vEOcYlcLKpE+b4NpvV9EY8REw 0lIyYOa0mpffjPr9TlrJP7K4g== 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:(13230022)(346002)(396003)(136003)(376002)(39830400003)(451199015)(36840700001)(46966006)(36860700001)(7596003)(7636003)(356005)(2906002)(478600001)(2616005)(186003)(6266002)(26005)(5660300002)(316002)(40480700001)(82310400005)(8936002)(36756003)(42186006)(86362001)(41300700001)(47076005)(336012)(8676002)(70586007)(70206006)(6916009)(38230200001)(81973001)(14776008)(79816003); DIR:OUT; SFP:1102; X-OriginatorOrg: masteringemacs.org X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2023 10:53:36.0075 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3532b31-297f-48ae-4688-08daf16697b5 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: CWLGBR01FT035.eop-gbr01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO4P265MB6252 Received-SPF: pass client-ip=40.107.11.139; envelope-from=mickey@masteringemacs.org; helo=GBR01-CWL-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:252905 Archived-At: The tree-sitter-enabled function, `treesit-transpose-sexps', that is called by transpose-sexps, is broken. It uses a naive method of sibling adjacency to determine transpositions. But it is unfortunately not correct. Python: def -!-foo(): pass Turns into this with `C-M-t': def ()foo: pass But it ought to be: foo def(): pass It's swapping two siblings that are indeed adjacent in the tree, but not on screen, which is confusing and a regression from its previous behaviour. You could make a cogent argument that both approaches are wrong from a syntactic perspective, but I think that misses the broader point that `C-M-t' now does something errant and unexpected. Worse, it's not possible to revert to the old behaviour (see bug#60654) In GNU Emacs 30.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2023-01-02 built on mickey-work Repository revision: c209802f7b3721a1b95113290934a23fee88f678 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Ubuntu 20.04.3 LTS