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: Fri, 15 Nov 2024 09:33:17 +0200 Message-ID: <86wmh5hrya.fsf@gnu.org> References: <86r07elwoh.fsf@gnu.org> <86h68al2qz.fsf@gnu.org> <867c95kaye.fsf@gnu.org> <861pzdk4aq.fsf@gnu.org> <86zfm1in2p.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14004"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 74339@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 15 08:38:18 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 1tBquI-0003U4-89 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Nov 2024 08:38:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBqtu-0002Z8-Ke; Fri, 15 Nov 2024 02:37:56 -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 1tBqt6-0001TH-BN for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 02:37:11 -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 1tBqt6-0000GG-2J for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 02:37:04 -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=Y/enR24DDXteTUfsKWd+9OT6/UOSXogJxutOxji17Tw=; b=g9qQXCAXd+vikLSOTMtfVJskGAfj8/yVfkakmbilSj9FFzh9+vZzxhhx9wt1+gID+YYb9aeew2qhyFCDq3C1KvpyNkweWl3lyEdSMYXD2HKAfZPCs2amdDTpXF7R8OGn95cQWOKKJC98c+npTX1kcpUNPoWO1eJhknX+toYJDCidotCGtlrlia8GawqBTZ5yQpA7hKIDkoKaNg/iR0VDM1jQV0Ol9DVXXMvOs36m/JmbcEiwEBd3J58FJAyQO5PJrktQAsXsoxIW426AxAxHAOzZYHqYsjlnHUjLxEAVC7S6O1KdorrERGdqEz4xQGFkYs2esChHeM6DzWZxDFuXDQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBqt4-0006VP-G2 for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 02:37: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: Fri, 15 Nov 2024 07:37: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.173165616724944 (code B ref 74339); Fri, 15 Nov 2024 07:37:02 +0000 Original-Received: (at 74339) by debbugs.gnu.org; 15 Nov 2024 07:36:07 +0000 Original-Received: from localhost ([127.0.0.1]:48366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBqsB-0006UF-Bl for submit@debbugs.gnu.org; Fri, 15 Nov 2024 02:36:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBqs8-0006Tg-Fn for 74339@debbugs.gnu.org; Fri, 15 Nov 2024 02:36:06 -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 1tBqpu-0007td-E9; Fri, 15 Nov 2024 02:33:47 -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=Y/enR24DDXteTUfsKWd+9OT6/UOSXogJxutOxji17Tw=; b=OXnjbKKvscTX enHzZp6C0CAP2KgJYwr6iwuAvjDu3UzIiujT81hVrLhNOOPMBtgH8Eo3dBheI3K8/vQ/LRl2LeidA /rMiYvaS2WHRUNTBgHpTMtQ62AX8O6VJoE5Z6JPwNubFqoXyvrFxt9Km9lhWGwzg6PwiYF2x3PLAt 9R6vpZxc+ha0EaXWPQXKY3uvLiNmWGoG/lb11viHJ1DVMvpAn3/EQ7m5osNtqMtditCuNqjnvl57d N4qycbP3fZxzpNtKyvr+cC4r37CDJSkN5wmJ4D9VUskax0DEv4edU1h+bgUsG26afjT6BKcIFm5IU d6bjQ0P8Yd6qTEJhewinlA==; In-Reply-To: (message from Alan Mackenzie on Thu, 14 Nov 2024 20:38:40 +0000) 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:295381 Archived-At: > Date: Thu, 14 Nov 2024 20:38:40 +0000 > Cc: 74339@debbugs.gnu.org, monnier@iro.umontreal.ca, acm@muc.de > From: Alan Mackenzie > > > What I meant is to modify cc-mode so that it removes the entries > > pushed to major-mode-remap-defaults by c-ts-mode and then pushes its > > own entries which map c-mode etc. to themselves. And c-ts-mode will > > be changed to do the opposite. This is a small, localized change, > > which will leave everything else intact, and will allow users to > > express their preferences by just loading the mode they want to use. > > How is that symmetrical between c-mode and c-ts-mode? The very nature of > the entries you're intending to make in major-mode-remap-defaults is > asymmetric, in that they would remap `c-mode', but wouldn't remap > `c-ts-mode'. Or have I missed something? The symmetry that I was talking about is in handling c-mode specification in auto-mode-alist: it will either invoke c-mode or c-ts-mode. This is the issue at hand: to allow users to express their preferences about c-mode in a way that is reversible. The symmetry is in what cc-mode and c-ts-mode do with major-mode-remap-defaults: each one of them removes the existing elements that remap c-mode and adds its own elements which prefer itself for C files. IOW, the symmetry is in allowing users to prefer c-mode or c-ts-mode as they wish, and allow them to change the preference during a session with predictable results, regardless of the preference: the preferred mode will be used after its file is reloaded. There was never a feature in Emacs to invoke c-mode when a file specifies c-ts-mode. (There are also no files which specify c-ts-mode in their file-local variables, and auto-mode-alist doesn't mention c-ts-mode, so such a remapping has a largely academic value.) The current code in cc-mode.el, which adds elements to major-mode-remap-defaults, doesn't remap c-ts-mode to c-mode, either. So this interpretation of "symmetry" is a separate issue that should be discussed separately, and we definitely don't want to add such features to the release branch at this point, even if we agree to having that in the future. (Stefan's thinking is that it's probably wrong to specify c-ts-mode in in auto-mode-alist and in file-local variables anyway, although this is still under discussion. If we agree to that, it would mean that specifying c-mode in auto-mode-alist and -* c -*- cookies in a file does not necessarily mean to invoke c-mode literally, but instead to invoke the mode in which the user wants to visit C files, i.e. a mode that is subject to user options. With that concept, remapping c-ts-mode to c-mode makes very little sense. But this all is not yet finalized, certainly not in Emacs 30, and thus is not relevant to the release branch, which is my main concern in this bug report.)