From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Subversion of user chosen major mode by Emacs. Date: Wed, 29 May 2024 12:51:52 +0000 Message-ID: References: <86r0dmtbk2.fsf@gnu.org> <63afa31a-7874-4d1f-a17a-14a64ba516cb@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16746"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Eli Zaretskii , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 29 14:52:49 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sCInR-00048O-5h for ged-emacs-devel@m.gmane-mx.org; Wed, 29 May 2024 14:52:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCIme-00069W-GH; Wed, 29 May 2024 08:52:00 -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 1sCImc-00067i-D4 for emacs-devel@gnu.org; Wed, 29 May 2024 08:51:58 -0400 Original-Received: from mail.muc.de ([193.149.48.3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCImZ-00088U-7U for emacs-devel@gnu.org; Wed, 29 May 2024 08:51:58 -0400 Original-Received: (qmail 38402 invoked by uid 3782); 29 May 2024 14:51:52 +0200 Original-Received: from muc.de (p4fe15a59.dip0.t-ipconnect.de [79.225.90.89]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 29 May 2024 14:51:52 +0200 Original-Received: (qmail 10690 invoked by uid 1000); 29 May 2024 12:51:52 -0000 Content-Disposition: inline In-Reply-To: <63afa31a-7874-4d1f-a17a-14a64ba516cb@gutov.dev> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.3; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319687 Archived-At: Hello, Dmitry. On Wed, May 29, 2024 at 14:43:29 +0300, Dmitry Gutov wrote: > On 29/05/2024 14:16, Alan Mackenzie wrote: > >> I think this is a misfeature of `c-ts-mode.el`, but this was the result > >> of a long discussion and I don't think we want to revisit that yet. > > Why did nobody involve me in this discussion, considering that the > > result involves "stealing" CC Mode users? > This behavior is not new: loading a *-ts-mode has been overriding the > user preferences since 2023-01-20 (commit 6b2f85caa6). That has nothing to do with my point it is supposedly answering. I've just had a look at that commit, and it simply adds entries to auto-mode-alist for the *-ts-mode modes in the traditional, normal and acceptable fashion. CC Mode does the same. The problem comes in a comment in that patch encouraging users to subvert the proper meaning of c-mode, etc., from being specific modes to being vague generic modes. This is completely unnecessary for the normal user who uses only the *-ts- modes and not CC Mode. It is a confusing mess for users who wish to use both of these, say for comparison. > Perhaps your personal customization for auto-mode-alist had been > shielding you from the original issue. You can add a similar entry to > major-mode-remap-alist. Not sure what "original issue" you're referring to. My customisation for auto-mode-alist is an eval-after-load for c-ts-mode which deletes the *-ts- entries from auto-mode-alist. This has worked fine until recently and should be restored to working again. All this confusion in auto-mode-alist, and the horrible workarounds of major-mode-remp_\(alist\|defaults\) result from a fundamental conceptual error, namely changing c-mode and friends from having specific meanings to being vague generic symbols. THIS is what I should have been consulted about, as the owner of these symbols. The latest symptom of this misunderstanding, which I bumped into yesterday, is that Emacs changes the major mode of a C buffer with M-x revert-buffer. This is clearly unacceptable. -- Alan Mackenzie (Nuremberg, Germany).