From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: bug#74339: 30.0.92; CC Mode stomps C TS Mode Date: Sat, 23 Nov 2024 23:35:10 -0500 Message-ID: References: <868qtnfd2d.fsf@gnu.org> <86r07elwoh.fsf@gnu.org> <86h68al2qz.fsf@gnu.org> <867c95kaye.fsf@gnu.org> <861pzdk4aq.fsf@gnu.org> <86r075qasz.fsf@gnu.org> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17294"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74339@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 24 05:38:24 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 1tF4O8-0004La-7B for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Nov 2024 05:38:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tF4Np-0006PT-2S; Sat, 23 Nov 2024 23:38:05 -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 1tF4Nn-0006Oi-I3 for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2024 23:38: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 1tF4Nn-0006SG-8K for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2024 23:38:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:References:In-Reply-To:From:To:Subject; bh=9H+IEoqHianLXZQ3Ntk7pXwM76aABjXI4KR7GDqK+gM=; b=oKyuzWS5TzkOnpSGfuHfiCTQBqliFbEMBmca2KRsVoS4PHFipjZPGEVEl6kTrtyCVKrGWP+rSHDjkRaDbT9iVr6D9X8IWdW4u2dUXCP9X9/hmWxgPy2zDdd1PYjWIfu0bHV8ipxZlL9+reiwJES40YMF0HJKFSsMQEAbsqOhcWj0OAgKWb2e+xNu3A5vgaWngcZ/HPMbzj3nYEk40gmF5KW5fXc8p9ecHydy779mCuS1lNWVIDC3mqH5o+231oP8PcU1b+nOH3fwc6feW8eLbNUwRENLflpJ6Mev1v1POwLRWuHCJXkfOYgjXaOdgwL2oR/MmpCzvOqGz6OT2wlD2g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tF4Nm-0002rA-J1 for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2024 23:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Nov 2024 04:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74339 X-GNU-PR-Package: emacs Original-Received: via spool by 74339-submit@debbugs.gnu.org id=B74339.173242304910911 (code B ref 74339); Sun, 24 Nov 2024 04:38:02 +0000 Original-Received: (at 74339) by debbugs.gnu.org; 24 Nov 2024 04:37:29 +0000 Original-Received: from localhost ([127.0.0.1]:60293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tF4NE-0002ps-DG for submit@debbugs.gnu.org; Sat, 23 Nov 2024 23:37:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tF4NC-0002pe-DU for 74339@debbugs.gnu.org; Sat, 23 Nov 2024 23:37:27 -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 1tF4L1-0005tk-Ju for 74339@debbugs.gnu.org; Sat, 23 Nov 2024 23:35:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=9H+IEoqHianLXZQ3Ntk7pXwM76aABjXI4KR7GDqK+gM=; b=ZBTzR5KOHCxF ScPnpdFZbGzyoN7M48uCbFDoGJXcd7ueq4GtlnVo+RHa8eme55v4DikQ48arp21nTPabMM3QonAZB E8gUPFZBiPsHNRv0dX3HP8Ntn5kHkovaHu0TRO7FFQF56CvjoL8fM7/gjaeHc7eNTuFIDrCgDutJf vZdxdESrD9xeDvpby1I4D8KI9SI1QEJQXlIFXyNfkU2QvUu9UbgFLNzgzkGAFazq68gMcRVfoxe4k t0ruhD68NTJf99MUkP8/FQGkTM9O5oeLRzgFiF8bvTvElzlhJdq9Cv8oJfEBTqJE4wxMyqiuVOfB4 sDyMGSKUswu3IBlFtxcfxA==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1tF4L0-0003d0-Fd; Sat, 23 Nov 2024 23:35:11 -0500 In-Reply-To: <86r075qasz.fsf@gnu.org> (message from Eli Zaretskii on Thu, 21 Nov 2024 09:57:00 +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:295883 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > I've now made changes in c-ts-mode.el on the emacs-30 branch that > allow to remap CC Mode's C/C++ modes to the corresponding tree-sitter > based modes as result of loading c-ts-mode, which resolves this bug. > (cc-mode.el remains unchanged, so loading cc-mode will revert to using > CC Mode, as it did before this change. IOW, the changes I installed > make it possible for users to prefer c-ts-mode if they want, and leave > intact the ability of users to prefer cc-mode if that is what they > want.) This does help a user insist on c-mode rather than c-ts-mode. However, setting that switch by loading file A or file B is not natural. In Emacs we try to have a user option to control such a choice. How about making a user option that will be tested on every occasion whet it is time to put a buffer in one of those modes? The simplest way is to call the option `c-mode-use-tree-sitter'. I think a similar option will be needed for each major mode that has a TS counterpart. We could have an option like that for each of those major modes. Other user interfaces involving a single option to specify which modes should get tree-sitter handling can be considered. I think the goals are (1) the Customize interface should handle these options cleanly. (2) a user should be able to set this just once, and the setting will stick in future Emacs versions (unless the user explicitly changes it) as long as this aspect of Emacs doesn't fundamentally change. There could also be a command M-x major-mode-use-tree-sitter which would toggle that switch for the current major mode. So if you use that command while in a C mode buffer, it would change the value of `c-mode-use-tree-sitter'. Perhaps it would also change the major mode in each buffer that uses `c-mode' or `c-ts-mode'. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)