From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Subversion of user chosen major mode by Emacs. Date: Wed, 29 May 2024 19:08:46 +0300 Message-ID: <4197c4a8-ee12-4fa7-9201-4d26f3be59c6@gutov.dev> References: <86r0dmtbk2.fsf@gnu.org> <63afa31a-7874-4d1f-a17a-14a64ba516cb@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39189"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Stefan Monnier , Eli Zaretskii , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 29 18:09:29 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 1sCLrk-0009uO-LE for ged-emacs-devel@m.gmane-mx.org; Wed, 29 May 2024 18:09:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCLrJ-0008Du-5l; Wed, 29 May 2024 12:09:01 -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 1sCLrG-0008DT-Bj for emacs-devel@gnu.org; Wed, 29 May 2024 12:08:58 -0400 Original-Received: from fout1-smtp.messagingengine.com ([103.168.172.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCLrB-0003AB-Dx; Wed, 29 May 2024 12:08:57 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 9B6401380081; Wed, 29 May 2024 12:08:50 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 29 May 2024 12:08:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1716998930; x=1717085330; bh=TQSb5yTW+2PiA5P3J/qD0czpmjzewYKwmxM+BYY23Gc=; b= XpCjrJae0scO/H0oiRQYqoEBRjyNtq27x2aYoNU78ZhAUI2nZXndUbgwQnlbrtvo 4+h7eAZ2Hr2vSlgTb7CImUA4tsOdmhtbylHZKmmHEV3pzmgVmLW/XR3x2U0rwuI6 gpNJcFDdfpR/R8gIoR/XEmqZj+VbtBIa7avVwWFr/o1I8hS8biY+K5H0IwYsASOU 78sFEihat/kadE4uk7Ab35Vfv8A8Eg+HjK4/KMCE7jHYZgVRU0RAcxL3W0e4i3Ng 9l+z+XtZFiDmRjAGyCQuNyyblDntcko0dAcPYSoM2zfVA0hLapZ2v4TtmTBeGto8 1nObi6B96LFUadrM63jZUg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1716998930; x= 1717085330; bh=TQSb5yTW+2PiA5P3J/qD0czpmjzewYKwmxM+BYY23Gc=; b=O knvMztCCfOYPANXilCh5l8Q3veD4ql/kIKDyXrGIVnObUCDNhGlfjzgzyUVM/j9X cudthpPbOIgxX1ty5qPk51QIuQ0GVfbkeBNW0vPEsYvVkqb+T0NaTXld925JMi5u CRgV+zp7VwQ9Jf53+gUk+QW6/2/OFnCpjN+AG1MpI5LfX0/Z836uUs1s3/qCdEOi NjAMekTvnkAYK4+vlJfpcEWEJ1hVKL259kCF7MYpaMh+kNUKXR+vBrnke4LmLG0S wrrzXdxPcQQhCF1t46IkTd5Mi+ALNDu4ceMBwyhhgL0/AZ5agdtwF+5hiDY6vxr+ BzZ9Fdwge/BC0ukVTaUmA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdekuddgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 29 May 2024 12:08:48 -0400 (EDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=103.168.172.144; envelope-from=dmitry@gutov.dev; helo=fout1-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_SBL_A=0.1 autolearn=ham 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:319697 Archived-At: Hi Alan, On 29/05/2024 15:51, Alan Mackenzie wrote: > 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. That's not the same thing: all CC Mode entries are behind ###autoload, meaning that the alist does not actually change when you load the file (as long as the autoloads are properly generated when you build Emacs). > 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. Naturally, this only works while auto-mode-alist remains the last source of truth regarding the mapping. > 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. I agree that the terminology might be confusing. We've had a discussion regarding adding the notion of "languages" to Emacs (I even posted a proposal), but so far we decided to go with the "lighter" solution. > 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. And that started happening since commit 6b2f85caa6, you can look for the related discussions and the objections that were voiced at the time.