From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74339: 30.0.92; CC Mode stomps C TS Mode Date: Thu, 14 Nov 2024 12:05:07 +0200 Message-ID: <86msi2jfl8.fsf@gnu.org> References: <868qtnfd2d.fsf@gnu.org> <86r07elwoh.fsf@gnu.org> <86h68al2qz.fsf@gnu.org> <697529d6-0591-4a80-b640-7ddce7dc246b@gutov.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3755"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, monnier@iro.umontreal.ca, 74339@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 14 11:06:23 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 1tBWk2-0000qS-HE for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Nov 2024 11:06:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBWjm-0000N0-Um; Thu, 14 Nov 2024 05:06:07 -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 1tBWjj-0000Mk-La for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 05:06: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 1tBWjj-0008LL-1c for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 05:06:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=//AzZYMqlSl4cUbxt3CnQashyBq96Qy4ApkDkQpEyzk=; b=m6cjwPA0q4vL8iGlSsUtFGq33WSa7JekcDoTpfA8fXtsPmZlnw5teNx/z0Q9V+LjJrLK4XpuEIxG4xjjKyOS91cdiTKlc8e2iYvAbqSrwIAfSfKyGI9LvSAANlvP4EADAZP0KneptSVPGfirDIlgMvDjqgti0eyIcIPJtkj5RArhAPltKop+K/JIm6ArzakfRvQwKsK+CXSwJDYWcLsVq8fhyeZoUagxIJBTkRJmedzlJ7WedsJa3NdOXAYGSc37qaDqfaB03x7Wo7J/52P26BdL/1YUuY7Xubzz4L4pS2Ecy28R5Rr1tnrDjreTJBC51pynmJ18PB2qdIDlJeJM/g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBWji-0005ji-TI for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 05:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Nov 2024 10:06: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.173157872621968 (code B ref 74339); Thu, 14 Nov 2024 10:06:02 +0000 Original-Received: (at 74339) by debbugs.gnu.org; 14 Nov 2024 10:05:26 +0000 Original-Received: from localhost ([127.0.0.1]:45132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBWj7-0005iE-Ip for submit@debbugs.gnu.org; Thu, 14 Nov 2024 05:05:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBWj2-0005hv-3E for 74339@debbugs.gnu.org; Thu, 14 Nov 2024 05:05:24 -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 1tBWiv-0008EX-0q; Thu, 14 Nov 2024 05:05:13 -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=//AzZYMqlSl4cUbxt3CnQashyBq96Qy4ApkDkQpEyzk=; b=fbouCi0bgrDL ujevfVSxu3MVGPrK0zs1ix5HZCkwIOn7XLJUQIwid/aQHaE7P3wpTGKy5wCb4TY674SH2AESvho8e fOtSQXjdyWxcDv1LML7HYQT97LDHVRkZ4OftvqknICYv/7TCjrjeJPhglN/sz0X+C9x3Y7RJ3iVOy tNqS9ceUIQYqS+60I+6BrRIZDY0xKhPWnB3+557m5vAJGeKPv/t3OruqtRzSFPYQvsWtqOL6A6mnK edmuQZwa1oGUO6cJTPKD2/EG09CZkjED/dPlOjhMuVOUp3Vqe4pkPJdLD7Udo0n5qZLgG7ZAoE3YC 3P6bejRqoboqH74fdfH1Dg==; In-Reply-To: <697529d6-0591-4a80-b640-7ddce7dc246b@gutov.dev> (message from Dmitry Gutov on Thu, 14 Nov 2024 11:24:32 +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:295324 Archived-At: > Date: Thu, 14 Nov 2024 11:24:32 +0200 > Cc: monnier@iro.umontreal.ca, 74339@debbugs.gnu.org > From: Dmitry Gutov > > On 14/11/2024 08:59, Eli Zaretskii wrote: > >> Can I take it that you will respect the choice of users who wish to > >> remain on CC Mode as much as those who wish the new tree-sitter modes? > > Of course! That's what happens by default if the user didn't load > > c-ts-mode, and (under my suggested idea of a change) will happen if > > the user loads cc-mode after loading c-ts-mode. IOW, the last mode > > loaded will "win". > > JFYI, 'M-x js-ts-mode' loads cc-mode. That's because js.el does that. This was so in Emacs 29 already. And there are other packages that do the same: $ fgrep -R "(require 'cc-mode)" ../lisp --include="*.el" ../lisp/generic-x.el:1275:(require 'cc-mode) ../lisp/org/ob-C.el:39:(require 'cc-mode) ../lisp/org/ob-fortran.el:36:(require 'cc-mode) ../lisp/progmodes/antlr-mode.el:84:(require 'cc-mode) ../lisp/progmodes/cmacexp.el:91:(require 'cc-mode) ../lisp/progmodes/csharp-mode.el:34:(require 'cc-mode) ../lisp/progmodes/cwarn.el:107:(require 'cc-mode) ../lisp/progmodes/hideif.el:120:(require 'cc-mode) ../lisp/progmodes/js.el:48:(require 'cc-mode) I guess users who use these features and want to use c-ts-mode as their C major mode will need to use with-eval-after-load to restore the preferences after loading one of these packages (or customize major-mode-remap-alist). Ugh! > >> And if a user has made no such choice, normal-mode will forcibly change > >> the major modes of their buffers, whether they like it or not. > > No, it won't. This could happen only if the user loads c-ts-mode > > in-between, which means the user prefers c-ts-mode. Without that, > > normal-mode will always revert to c-mode in the default Emacs > > configuration. > > I'm personally skeptical that loading a package (or invoking a mode) > indicates a strong user preference, but ok, let's call it that. We can change this in Emacs 31, but it's too late for Emacs 30.