From unknown Wed Jun 18 23:04:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#60880 <60880@debbugs.gnu.org> To: bug#60880 <60880@debbugs.gnu.org> Subject: Status: 30.0.50; tree-sitter `treesit-explore-mode' is buggy and does not behave properly Reply-To: bug#60880 <60880@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:04:43 +0000 retitle 60880 30.0.50; tree-sitter `treesit-explore-mode' is buggy and does= not behave properly reassign 60880 emacs submitter 60880 Mickey Petersen severity 60880 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 17 08:49:47 2023 Received: (at submit) by debbugs.gnu.org; 17 Jan 2023 13:49:47 +0000 Received: from localhost ([127.0.0.1]:36120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHmLS-0008QE-Rl for submit@debbugs.gnu.org; Tue, 17 Jan 2023 08:49:47 -0500 Received: from lists.gnu.org ([209.51.188.17]:38508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHmLP-0008Q1-92 for submit@debbugs.gnu.org; Tue, 17 Jan 2023 08:49:46 -0500 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 1pHmLL-0006a3-0H for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 08:49:39 -0500 Received: from mail-lo2gbr01on0706.outbound.protection.outlook.com ([2a01:111:f400:fe15::706] helo=GBR01-LO2-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 1pHmLG-0005KQ-TD for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 08:49:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IMY5Z5GwV7YmpttdNrutzESwrOWih4Pt2886TcIq7F0HN+Sqz3KgC0HTmDmC/SMEfOUmwu2M2mlz+vCgI2YkpsgZszT6+tTYOvrFJ5/jpg3Y6sucu4BjRPBqPYRT7MW76/xgFFHlfRDMnw0I4RFI9ij9azn2zzdKXzpJpsYhnoSKPNLUiKQdoaO4uopeeA/WY7CqqhdZg0vwiQWpFJaO8xNzNUNlamOdSRMQysl6fI/8SbXOKMaK1laIG0l4YfSPAKIFKC1+Ud0u6LtTI42h3Pt+d5U7i+SUgm4c2zKHO5q4Wrrfjz9xshRChzGxozAufDpjRbOJS4oCoD+Zh46Kaw== 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=tUgpzQTsmFAhNZmkAjhGEr+9xDGBSAGG77cO72VpGZI=; b=fU7krpfhbGWw0CUzc0wmj2hkRbqbhY+9c4bs8j7GDdn4VmW1EmZKxie4zRvO9GHBeKhpbgolwm2HBMZxtYjBxo/CMWAlY9ZeMIZdhheojwPJcghyp8qQ1RMmE6JlpYIv9ieFrlqNXDus2npJ5EjektAZdfFxG7UpxrhVcS0YNdKQQ8ozt7Z7uQIbv0mGsAAxxNEIvI/63MkpPuP6wFhlN/PqERwo1HTExvjTEAVH6ElWAdv7PTTzmEEbR5uZ79mLvxs5aTuVL66///+XnO7wEdlmld2TGor/8FZeNjjT+UCo9gljcxfdbwKe5slSpueQ03c1Tw6q9Wp2FlEM3J194w== 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=tUgpzQTsmFAhNZmkAjhGEr+9xDGBSAGG77cO72VpGZI=; b=eTipvWb50AS6WqI6JmtjccnqOL5pOBbIMt4E4tjBJa0PB2SlsE8/l4U3YusRADPW0XjInEkr1mgoe/5Gc1qVDFXE3jMUWsNGXVab8htjbXZ7Alc0wtwyBbTf75cC7AlBu6x1/oduIJYLo7YJ2IBKoFjARjvvF+jRb8W4v9F59bQ= Received: from LO6P123CA0059.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:310::17) by LOYP265MB1791.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Tue, 17 Jan 2023 13:44:29 +0000 Received: from LO2GBR01FT024.eop-gbr01.prod.protection.outlook.com (2603:10a6:600:310:cafe::90) by LO6P123CA0059.outlook.office365.com (2603:10a6:600:310::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend Transport; Tue, 17 Jan 2023 13:44:28 +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 Received: from semantical.co.uk (178.79.136.144) by LO2GBR01FT024.mail.protection.outlook.com (10.152.42.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Tue, 17 Jan 2023 13:44:28 +0000 Received: by semantical.co.uk (Postfix, from userid 5001) id 2F1B2114002; Tue, 17 Jan 2023 13:44:28 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=masteringemacs.org; s=masteringemacs.org; t=1673963068; bh=tUgpzQTsmFAhNZmkAjhGEr+9xDGBSAGG77cO72VpGZI=; h=From:To:Subject:Date:From; b=e2ntdwQPSrSxH+3RdmByWR/9yFHxQhe/CACId1UVBTMhgnGvBFHw+rP0bT5paST6N VWDPxuLIrc64sykxEUKP+MC/3+Qob/cRd0xgpdUjvWDxLR9eSnQ7yJqqcno/0gqjBu UtsXrv00HCcy6EXTExlY+k33ACLCEUaidotBe3wQ= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on semantical.co.uk X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_RECEIVED, NO_RELAYS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 From: Mickey Petersen To: bug-gnu-emacs@gnu.org Subject: 30.0.50; tree-sitter `treesit-explore-mode' is buggy and does not behave properly Date: Tue, 17 Jan 2023 13:44:21 +0000 Message-ID: <87wn5ls2bu.fsf@masteringemacs.org> Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO2GBR01FT024:EE_|LOYP265MB1791:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 31d2fef5-da98-48e5-a84a-08daf890f462 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8OfyT8+/xDiyxU0Et0HiHM6FenP8JADeLiq9v55beqZEOF8grbTbeWTrFNs3sijssdwhDXpDm9F3tHmQAtLTvFsWGYfHMwR/T21ryPZrO/D4awXYdjgLeZVZlNjwdhVcuvTV1DW3B/yc7DbYA7/jCvp8up0AjYBulGUlSR6bHTbSwrFR5g4e2T4vBaemncn+SxNkoeSB4NOw2D+vfDb7w8Q5bM1foLvr0kWj4NHfLc5+TYLgfTfdx4BNqNpH8qtaATX0jnr58+hcDsSXwowTqdbCdVmePQD6alA3epX1/ou8vNzzvIJsk8o5nj7WcLfteXyvyDglyamvWKIaydf5xWU+TiCWSeUF0DyVzjpTlsZEcz7kKQL3a1u3aR1LpNkPUGqzuBmgBcME9aBZnktMpzt80BPVcicIIX92cavb0SimZJoxECJigUlJ8HiWYKgfpYWlhHJ1LWcJtqd0PUBlzCSO6vOcEYsQCrimgh/FWl28JcGznBiitJtugT+Z+XUg2YD+Q4yzEl+ij80ruuEA/xFz09CWOUr04ofL1rDxq1ClKUU8rgDNOJwaWgTIPY4n62OfuffDD3w8c6p0jFB9j1M0dOED5frCUXClfHUoWeQx7F5SEyD2oa/FiUsWZphn7J6MbEobLdd94/5Ax3XMaKJQ0wqCamwhqCINyMqlDeQgni/eWRhtRFrhuxm265TqtVjBtPT3fPImV0hf+Tnzm6euNnjwSTxxtnhXfPQ5ALZgXyfFEf2boj3Kv3U6iXApXDkAnIWi5Mp/nVb48WoQDw== 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)(82310400005)(36756003)(86362001)(6916009)(186003)(26005)(41300700001)(8676002)(70586007)(70206006)(6266002)(2616005)(47076005)(316002)(7596003)(6666004)(478600001)(2906002)(42186006)(7636003)(356005)(5660300002)(36860700001)(336012)(8936002)(40480700001)(38230200001)(81973001)(79816003)(14776008); DIR:OUT; SFP:1102; X-OriginatorOrg: masteringemacs.org X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 13:44:28.4806 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31d2fef5-da98-48e5-a84a-08daf890f462 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: LO2GBR01FT024.eop-gbr01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LOYP265MB1791 Received-SPF: pass client-ip=2a01:111:f400:fe15::706; envelope-from=mickey@masteringemacs.org; helo=GBR01-LO2-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) A medley of issues here: 1. Executing `treesit-explore-mode' on a buffer with no valid grammar support causes the minor mode (and playground buffer) to stick around and "load" anyway. 2. Bailing out of the grammar prompt does not, in actual fact, stop explore mode from proceeding. Instead it creates an empty buffer and it still engages the minor mode. 3. Killing the playground buffer does not remove the explore mode buffer. 4. treesit-explore-mode is stored against a buffer during `desktop-save' (and subsequently read with) `desktop-read'. Thus broken buffers or files inherit the explore mode. This is especially pernicious due to #1, #2, and #3. In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2023-01-17 built on mickey-work Repository revision: bb383a54910c3094e5d228e0af62bf70e36203ca Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Ubuntu 20.04.3 LTS Configured using: 'configure --with-native-compilation --with-json --with-mailutils --without-compress-install --with-imagemagick CC=gcc-10' From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 19 17:31:08 2023 Received: (at 60880) by debbugs.gnu.org; 19 Jan 2023 22:31:08 +0000 Received: from localhost ([127.0.0.1]:44920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIdR6-0002nm-75 for submit@debbugs.gnu.org; Thu, 19 Jan 2023 17:31:08 -0500 Received: from mail-pf1-f175.google.com ([209.85.210.175]:38517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIdR2-0002nD-HO for 60880@debbugs.gnu.org; Thu, 19 Jan 2023 17:31:06 -0500 Received: by mail-pf1-f175.google.com with SMTP id 207so2638666pfv.5 for <60880@debbugs.gnu.org>; Thu, 19 Jan 2023 14:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=8l5RWG7bv1zkbqfw3lIX3xC1o1DlU7tSIj/BlzMF+H4=; b=BdUrNL2q4KUvlB8eaoyehiLR12rSbrvBgxGMerOQ7CML7c/MLmj2sGTFaouWwSpMUu 0wJk+xOd06AdZKW1Ms2xKq0JErMY6bj60FkxkRX5/lNzrZR8RSb9hItXQ0sAgOEbMAPC kl1RfAL4tXCZMFlOy/khlk8OYXcd8DjUTamHpcafpTU8WL4Advxpj8qQwmVof0DBbTmk VIVTDrIOJKIKWoTvePFbEZwmONWN0k+QuM5Je6kblkN6anbEaX46rrLqIhFmlGrbiqLP sGZevVyJIgeFZ7WI1JNv6Dgf0oee+dNnv5czd3s1G5DnJQKzLWnD844Y6fWpxP/x7WXC /5AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8l5RWG7bv1zkbqfw3lIX3xC1o1DlU7tSIj/BlzMF+H4=; b=2gntTg7GPciC2sQGfjQNA+RgG8975/3fKMZ5Q6wITbQHVvEbhnvjUcA+Uo40POpuTy RTSHoRvBtClWRFYaqWZIcozPtqsgWDl8MnqOk/LSWHQN6qPCBlYS6mvm4TrE+aBtP9is KBIl5NpXlf1/CXYJhb7hVog+QYZVuvsCbAUch7q0Y2Y6rSOXZ/RRHmHE5+aIIXnezaOv AZ+1J1gwLStq8ccI+Fo5qNwhtxrHMDf7icPbbR1zQqYcA9dnjeWiLG9gWedg2YP3Rq+H mqfk86KLrJ3JbeR572R/WsXStOQ5EPWnEodDo64l70pESrN1oDTn/hkwmJqToe+UgXv1 P2eA== X-Gm-Message-State: AFqh2kqsBTbCDVaZyG17phIuXH9pnAaxS7A5GCCSlgKWMQN6IiFJiaQz OqJ5KvOk4i0BCChxy4IqT784TWxUnKk= X-Google-Smtp-Source: AMrXdXt1NeIZkWoY0gcu8CPUJx148bAmSo+UQEulyfywWMcqe+f5/qyergzkSnyCiz+wI/Do5G7tRQ== X-Received: by 2002:a05:6a00:4c9c:b0:56e:a7a7:35a0 with SMTP id eb28-20020a056a004c9c00b0056ea7a735a0mr13652117pfb.25.1674167458600; Thu, 19 Jan 2023 14:30:58 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id f13-20020aa7968d000000b0056b4c5dde61sm12847908pfk.98.2023.01.19.14.30.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jan 2023 14:30:58 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: bug#60880: 30.0.50; tree-sitter `treesit-explore-mode' is buggy and does not behave properly Message-Id: <616F5C5A-1D12-4E14-90D4-8ABE7FD869BD@gmail.com> Date: Thu, 19 Jan 2023 14:30:46 -0800 To: Mickey Petersen X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60880 Cc: 60880@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mickey Petersen writes: > A medley of issues here: > > 1. Executing `treesit-explore-mode' on a buffer with no valid grammar > support causes the minor mode (and playground buffer) to stick around = and "load" anyway. > > 2. Bailing out of the grammar prompt does not, in actual fact, stop > explore mode from proceeding. Instead it creates an empty buffer and > it still engages the minor mode. > > 3. Killing the playground buffer does not remove the explore mode = buffer. > > 4. treesit-explore-mode is stored against a buffer during > `desktop-save' (and subsequently read with) `desktop-read'. Thus > broken buffers or files inherit the explore mode. This is especially > pernicious due to #1, #2, and #3. Ok, I fixed those problems. Now if the language is not available, treesit-explore-mode raises an error instead of continuing, desktop-save will not save the explorer buffer, and killing the source buffer also kills the explorer buffer. Invalid language doesn=E2=80=99t stop treesit-explore-mode from turning = on, even if it doesn=E2=80=99t create buffers, etc, since I think this is how = minor modes usually behave. Yuan From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 20 02:02:15 2023 Received: (at 60880) by debbugs.gnu.org; 20 Jan 2023 07:02:15 +0000 Received: from localhost ([127.0.0.1]:45301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIlPi-0007r8-MQ for submit@debbugs.gnu.org; Fri, 20 Jan 2023 02:02:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIlPe-0007qq-On for 60880@debbugs.gnu.org; Fri, 20 Jan 2023 02:02:13 -0500 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 1pIlPY-0005NW-Hc; Fri, 20 Jan 2023 02:02:04 -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=gQFzYdXFtbQJ1GL4oEdtw1JrSsAVyrItw2v9BZCIJLM=; b=jv3Ljsq44Jrd atMWP8QgN7/ylijAdtDMrDZCiFXlPp3S7Y0uaMDpsbGGIPeSG4yYNh4dyqxgaWnn6fNJTmp0x/4U1 Fus5TDxgN9lGsxrEdkzF7VtCIvczZRkSZA605KLKO4x4cHmTUqV6rq2Y6v7kyhxaE5xsHIqKf0hWV gNFQZmlFJ1sMXWdSUp52uLS++FpX0LvdIf9duYTujJtRsb7qs6hKi9n6TIyahKNdGuS4oxVYaWwZn YpDvVxJ+wNB5d/vpFEAjt7JXZZrPEChfe9ayd2EWov4LJH+A5rj1HrirV1RAu2fSiPH+gNpjgFApg P7smerGtxW2KFY6qOpMQEg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIlPX-0007Py-Ko; Fri, 20 Jan 2023 02:02:04 -0500 Date: Fri, 20 Jan 2023 09:02:01 +0200 Message-Id: <83ilh1ofiu.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: <616F5C5A-1D12-4E14-90D4-8ABE7FD869BD@gmail.com> (message from Yuan Fu on Thu, 19 Jan 2023 14:30:46 -0800) Subject: Re: bug#60880: 30.0.50; tree-sitter `treesit-explore-mode' is buggy and does not behave properly References: <87wn5ls2bu.fsf@masteringemacs.org> <616F5C5A-1D12-4E14-90D4-8ABE7FD869BD@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60880 Cc: 60880@debbugs.gnu.org, mickey@masteringemacs.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 60880@debbugs.gnu.org > From: Yuan Fu > Date: Thu, 19 Jan 2023 14:30:46 -0800 > > > Mickey Petersen writes: > > > A medley of issues here: > > > > 1. Executing `treesit-explore-mode' on a buffer with no valid grammar > > support causes the minor mode (and playground buffer) to stick around and "load" anyway. > > > > 2. Bailing out of the grammar prompt does not, in actual fact, stop > > explore mode from proceeding. Instead it creates an empty buffer and > > it still engages the minor mode. > > > > 3. Killing the playground buffer does not remove the explore mode buffer. > > > > 4. treesit-explore-mode is stored against a buffer during > > `desktop-save' (and subsequently read with) `desktop-read'. Thus > > broken buffers or files inherit the explore mode. This is especially > > pernicious due to #1, #2, and #3. > > Ok, I fixed those problems. Now if the language is not available, > treesit-explore-mode raises an error instead of continuing, desktop-save > will not save the explorer buffer, and killing the source buffer also > kills the explorer buffer. I don't think the desktop-save part is correct: the test should be at desktop-read time, not at desktop-save time. Because the fact we had the language available when we saved the desktop doesn't guarantee we will have it available when restoring that desktop: it could be in a different build of Emacs or even on a different machine. I'm not sure I understand the problem which desktop-read has when restoring desktop with buffers in treesit-explore-mode, but if the problems are more than just warning messages, then desktop-read should detect these problems, emit an echo-area message, and refrain from restoring the mode. Like it does with buffers that visited files which are no longer there, for example. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 20 03:20:02 2023 Received: (at 60880) by debbugs.gnu.org; 20 Jan 2023 08:20:02 +0000 Received: from localhost ([127.0.0.1]:45361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pImcz-0001Pj-4s for submit@debbugs.gnu.org; Fri, 20 Jan 2023 03:20:02 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:53879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pImcu-0001PS-PR for 60880@debbugs.gnu.org; Fri, 20 Jan 2023 03:20:00 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id E1580FF802; Fri, 20 Jan 2023 08:19:48 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#60880: 30.0.50; tree-sitter `treesit-explore-mode' is buggy and does not behave properly In-Reply-To: <83ilh1ofiu.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Jan 2023 09:02:01 +0200") Organization: LINKOV.NET References: <87wn5ls2bu.fsf@masteringemacs.org> <616F5C5A-1D12-4E14-90D4-8ABE7FD869BD@gmail.com> <83ilh1ofiu.fsf@gnu.org> Date: Fri, 20 Jan 2023 09:59:09 +0200 Message-ID: <8635856316.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60880 Cc: 60880@debbugs.gnu.org, Yuan Fu , mickey@masteringemacs.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I don't think the desktop-save part is correct: the test should be at > desktop-read time, not at desktop-save time. Because the fact we had > the language available when we saved the desktop doesn't guarantee we > will have it available when restoring that desktop: it could be in a > different build of Emacs or even on a different machine. When the buffer is not saved, then it will cause no problems when restoring. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 20 04:11:46 2023 Received: (at 60880) by debbugs.gnu.org; 20 Jan 2023 09:11:46 +0000 Received: from localhost ([127.0.0.1]:45577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pInR4-0007XT-07 for submit@debbugs.gnu.org; Fri, 20 Jan 2023 04:11:46 -0500 Received: from mail-lo2gbr01on2136.outbound.protection.outlook.com ([40.107.10.136]:23072 helo=GBR01-LO2-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pInQz-0007XB-8Y for 60880@debbugs.gnu.org; Fri, 20 Jan 2023 04:11:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bih3ajoN0cdxkpsqpxjnvI/eOwg5AThd8k2kP+X30YwNRNC82odhFVGaLsmORIR25G+v+0lfvT3b8WyTzmYQ33oyFIALdAOgMpzpmabe2V5qDe8XytxWjAiqMeF81P57JU/bAIoOVlm0w3YlQFneDzjsu3EUX8/iPsGoqsrXU4IsJssLAXz5dSq24Bmaz+31kClzxriqNZPKuDExZzgZuH8nizIdpBfnLKGkDZlTjC7RFKD3Yp3mG0FVronoacexhLzJ2AUALxaBy42gUgYJ6hImFJlpqOY2DGCBlFzfARUvN8ktKXVhaGBlqCiC3eYXC8YLSnKRis2srwYUmUJfwg== 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=2mnZFyvNeeT6oHkcYdxhpClerQF+XCxP/VU8oPPPP4c=; b=bej/7MpDwcCLQxJGEFLhdFSQ3YFJ3+gMp8GKhjF8Xro13giHnTXW/WvJXVDQKGjbTFTkjeOghviJB3mvGFrgqSPE9BJExKFtrgnAHvqSM5G7rVSIl84nZADt4GY3B4NbS4a/d6QAiXskn+ehI1jM/XXg3XNbzBIrk9WZxoEEbNgzU6cU7fpYXplz/8RF5G+l5xPhvbKMScQhiSrCOyWHFdEzp5bkjK1mj6dbmAvSr5gxNYOw2grJlxbXhBWykhlRL/veJ7eq/wdhiTkkbv1iKFkIXrWz6MsP+qyBhYee6Lw2rEplY8cVWtdyf2lIJEtHbyeWUOXp6nOyHn4BADrGfA== 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=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=2mnZFyvNeeT6oHkcYdxhpClerQF+XCxP/VU8oPPPP4c=; b=MfSKtqI+6RyqvfqjKaFPkl5JRujSg+wP7txVweWu7jGEpzQDCFABPKCPtvXrWaQRQ5IvFWOh5V90R8DPnL+Xxp3DM5BEgFXsesv+lHkHfl2UTbjp6LiwlvRaIVs9Te5dEwIh6GOHFjANAdRNPHFFIuj7hXXwSuw27fi8vZ6YVAc= Received: from LO2P123CA0088.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:138::21) by CWLP265MB5305.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:1c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.27; Fri, 20 Jan 2023 09:11:25 +0000 Received: from LO2GBR01FT015.eop-gbr01.prod.protection.outlook.com (2603:10a6:600:138:cafe::c4) by LO2P123CA0088.outlook.office365.com (2603:10a6:600:138::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.27 via Frontend Transport; Fri, 20 Jan 2023 09:11:25 +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 Received: from semantical.co.uk (178.79.136.144) by LO2GBR01FT015.mail.protection.outlook.com (10.152.42.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6023.16 via Frontend Transport; Fri, 20 Jan 2023 09:11:24 +0000 Received: by semantical.co.uk (Postfix, from userid 5001) id D269C114003; Fri, 20 Jan 2023 09:11:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=masteringemacs.org; s=masteringemacs.org; t=1674205883; bh=QfON3TjaAQLYXHmm8zPRJEDcULVzwSjrZEbCRSTd8eI=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=WUuZCBn4rGp+/0syg0Ghzr1by0rUecnlXCyxdgTDmaq4eGligztyY/EJ70GwJ0m4Y S6QlI03p5q9G1Ltm4JWI6FskpWuKPLmHHuQ0ll8zmveNGbvCMFaNwpdOpOoy5V+KD2 FMwsiYhVaR1r+VRhjvvHsKIpdxy6NHlXa1L+n7K4= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on semantical.co.uk X-Spam-Level: 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 References: <87wn5ls2bu.fsf@masteringemacs.org> <616F5C5A-1D12-4E14-90D4-8ABE7FD869BD@gmail.com> <83ilh1ofiu.fsf@gnu.org> User-agent: mu4e @VERSION@; emacs 30.0.50 From: Mickey Petersen To: Eli Zaretskii Subject: Re: bug#60880: 30.0.50; tree-sitter `treesit-explore-mode' is buggy and does not behave properly Date: Fri, 20 Jan 2023 09:08:09 +0000 Organization: Mastering Emacs In-reply-to: <83ilh1ofiu.fsf@gnu.org> Message-ID: <873585fu4o.fsf@masteringemacs.org> Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO2GBR01FT015:EE_|CWLP265MB5305:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: ac3165a2-764a-4b6c-a080-08dafac64dc4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dbxlxyV6cfC8oUZx1746oxz8x52Csa7MPc5WwBuSMeYnEWm8Pq4zVQAEsFD5dkSB2p732PCOKVtuWGgjaUb8j3HxTyMMlZ43Sl6bg+rCNK0QNF8EaIaagg1bx1WllKnHae6ugdVUoVo7qBdAhomhviEZqLdGEf1uHz1k2fI7OTiSOCIpvDMFQtHalpiyZMBoF2urT8GoIunMkMxe347gYlRmPpjNSEIwGEWa5MdFKNtj5OOWtzvtaUVlSvnKt+FcSytQVvTYMQzXFCOaKEwsLH9rHdXEU6NEt8dY5FvcYgSq4dLaCh6RvhuVRbdmz8Z2sq9MHQP5bNB9bRRnjYF1fFBN0v7biIubUYEPFyCAM97JzpD24k9sF00vWUea538XUBjNrofTIuQm1XBwdQYGkuEVaqPV/uC8agu6DPF8hE5oJOStQ0ShD+sxe5O00qED38RhRx8P71Bu7PKAKRBr+8nwyX7tR09a+vAsUmfWT5nLS8OdofqSVGgmKJcgtafvLr+NN8KixjLCxKac0NIV5csczpxsvWnO7oauwunAckDf4kK5G+7aYIj/HU6jgbxpVKLoIQpK6zLetC9CyGN1b/QrB0W1bIxEXDK2TqU6f1k2MPFJABdoHR2BJF/ZjStgO0GuDNYziMUvnSxICQGotUT9QvDDSuBz8TNLnpwH8OJ+GmsCb5SvvVXXSvrN7n8pz8BMnl9SMn3TF6ddYuzItcjLst8JUVpoONiQ/yv+71/AjpssClwlTYxgCbCmkPikYT6u9JP7R6biMwHojo8Kmw== 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)(136003)(376002)(396003)(39830400003)(451199015)(46966006)(36840700001)(40480700001)(478600001)(36916002)(6666004)(70586007)(4326008)(70206006)(8676002)(316002)(186003)(26005)(6266002)(5660300002)(336012)(6862004)(8936002)(41300700001)(36756003)(2616005)(83380400001)(2906002)(42186006)(86362001)(36860700001)(47076005)(356005)(7636003)(7596003)(82310400005)(38230200001)(81973001)(14776008)(79816003); DIR:OUT; SFP:1102; X-OriginatorOrg: masteringemacs.org X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2023 09:11:24.1078 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac3165a2-764a-4b6c-a080-08dafac64dc4 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: LO2GBR01FT015.eop-gbr01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP265MB5305 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60880 Cc: 60880@debbugs.gnu.org, Yuan Fu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> Cc: 60880@debbugs.gnu.org >> From: Yuan Fu >> Date: Thu, 19 Jan 2023 14:30:46 -0800 >> >> >> Mickey Petersen writes: >> >> > A medley of issues here: >> > >> > 1. Executing `treesit-explore-mode' on a buffer with no valid grammar >> > support causes the minor mode (and playground buffer) to stick around and "load" anyway. >> > >> > 2. Bailing out of the grammar prompt does not, in actual fact, stop >> > explore mode from proceeding. Instead it creates an empty buffer and >> > it still engages the minor mode. >> > >> > 3. Killing the playground buffer does not remove the explore mode buffer. >> > >> > 4. treesit-explore-mode is stored against a buffer during >> > `desktop-save' (and subsequently read with) `desktop-read'. Thus >> > broken buffers or files inherit the explore mode. This is especially >> > pernicious due to #1, #2, and #3. >> >> Ok, I fixed those problems. Now if the language is not available, >> treesit-explore-mode raises an error instead of continuing, desktop-save >> will not save the explorer buffer, and killing the source buffer also >> kills the explorer buffer. > > I don't think the desktop-save part is correct: the test should be at > desktop-read time, not at desktop-save time. Because the fact we had > the language available when we saved the desktop doesn't guarantee we > will have it available when restoring that desktop: it could be in a > different build of Emacs or even on a different machine. > > I'm not sure I understand the problem which desktop-read has when > restoring desktop with buffers in treesit-explore-mode, but if the > problems are more than just warning messages, then desktop-read should > detect these problems, emit an echo-area message, and refrain from > restoring the mode. Like it does with buffers that visited files > which are no longer there, for example. Another problem is that it stops the loading process, pending manual selection of the grammar you want explore mode to use. It would be nice if we saved the previous choice -- when you made the choice to begin with -- so that, upon read, it does not have to ask. That way the desktop read experience is not interrupted by prompts during Emacs startup. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 20 08:14:05 2023 Received: (at 60880) by debbugs.gnu.org; 20 Jan 2023 13:14:05 +0000 Received: from localhost ([127.0.0.1]:45831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIrDY-0007ys-PE for submit@debbugs.gnu.org; Fri, 20 Jan 2023 08:14:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIrDX-0007y6-A5 for 60880@debbugs.gnu.org; Fri, 20 Jan 2023 08:14:03 -0500 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 1pIrDR-0000jS-3h; Fri, 20 Jan 2023 08:13:57 -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=q11DwOnW27JShUGp7KeTTJL8uZMol3oNvPafX02Slpo=; b=iPBRGl/YeWUT GiTKvrxVx1XLL4RlvMSslxb1YXHI52OLHKn817WxeYBY79t7CVwHf0UQBejQ2vrrEnJTYFbJQzl/Y Wr29HJD2izcPIyUWbtDcPmoNpz9+1/3+/5V4tpFWYtXQzh7ZZjPtJcSA5eIae6fCjWWpPNnQAK5// 6MQBS/hKLiglAbrVMfPyAARzJh94Zee43elCruj46u79zCThQwMeiApgI6v6pz3jPPN8c+61F+TNw 5hdZkN8Cmt3DpQFaihgzQoJL2Va17uh+Zn5QAag7YxtNuAafVaczOnvypaHzZVGF4OJjzecDu5ljX 1tGQzLHoN/Pdc0Q/smLRaw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIrDQ-0002lP-I0; Fri, 20 Jan 2023 08:13:56 -0500 Date: Fri, 20 Jan 2023 15:13:56 +0200 Message-Id: <837cxhnyaz.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <8635856316.fsf@mail.linkov.net> (message from Juri Linkov on Fri, 20 Jan 2023 09:59:09 +0200) Subject: Re: bug#60880: 30.0.50; tree-sitter `treesit-explore-mode' is buggy and does not behave properly References: <87wn5ls2bu.fsf@masteringemacs.org> <616F5C5A-1D12-4E14-90D4-8ABE7FD869BD@gmail.com> <83ilh1ofiu.fsf@gnu.org> <8635856316.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60880 Cc: 60880@debbugs.gnu.org, casouri@gmail.com, mickey@masteringemacs.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: Yuan Fu , 60880@debbugs.gnu.org, > mickey@masteringemacs.org > Date: Fri, 20 Jan 2023 09:59:09 +0200 > > > I don't think the desktop-save part is correct: the test should be at > > desktop-read time, not at desktop-save time. Because the fact we had > > the language available when we saved the desktop doesn't guarantee we > > will have it available when restoring that desktop: it could be in a > > different build of Emacs or even on a different machine. > > When the buffer is not saved, then it will cause no problems when restoring. But users can expect the buffer to be saved and restored, when that presents no problems. We cannot unilaterally decide they cannot expect such buffers with their modes being restored.