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: Sat, 16 Nov 2024 12:25:57 +0200 Message-ID: <86wmh3h3uy.fsf@gnu.org> References: <861pzdk4aq.fsf@gnu.org> <86zfm1in2p.fsf@gnu.org> <86wmh5hrya.fsf@gnu.org> <86cyiwimlr.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21234"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 74339@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 16 11:27:26 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 1tCG1U-0005MC-Lj for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Nov 2024 11:27:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCG19-0005eg-LP; Sat, 16 Nov 2024 05:27:03 -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 1tCG18-0005eU-3f for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 05:27:02 -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 1tCG17-0002Fn-RI for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 05:27:01 -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=9wCA4RPTrYNvn0e/Dyb2qCJ9lHOATPCRSeXC6Pr6sM0=; b=HSf0mabKzShPeXrZMJAw9GjtsdtJMM8cujPXtlY8z5IQw76sYeH+DFuNNzZQSS6EhEZTc7ASenYxSs0pSr0RhsZaoX5bG4eTqWuQniq7mmkL8IxOHBS+37gxyudpdqIJzJtu6MshhOVtW5VIBCKejZXywidWVIIR8jhqa34TFSSORDpkBxtHsQoZUrWji2dHhd01M23CRb8/q+vFoslRWfbeCklmUEdv7Y3YWyEXiNnKCoWeEVUbvh/yRIWNDcM6XY2EF6Xhprlz4wETj6kUasNd7GC4TFQg8IeXv9upZWNhf8jwL3y8H626891sNGmLBjT29C6yUEgzgyztrZA6+A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tCG17-0002n4-Mv for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 05:27:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2024 10:27:01 +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.173175277210647 (code B ref 74339); Sat, 16 Nov 2024 10:27:01 +0000 Original-Received: (at 74339) by debbugs.gnu.org; 16 Nov 2024 10:26:12 +0000 Original-Received: from localhost ([127.0.0.1]:52186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCG0K-0002lf-Bs for submit@debbugs.gnu.org; Sat, 16 Nov 2024 05:26:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCG0I-0002lN-3C for 74339@debbugs.gnu.org; Sat, 16 Nov 2024 05:26:10 -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 1tCG0A-0002Bv-5F; Sat, 16 Nov 2024 05:26:02 -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=9wCA4RPTrYNvn0e/Dyb2qCJ9lHOATPCRSeXC6Pr6sM0=; b=lbstoAeGGElI brM2dMY2Rtii5YIRMOo338k9r782bbloatutTL17XzF5grKMxdyzsqm9yt+4JCJyCsJ7pLyaYqJev mx2U/whWBrpGWC77WPHvA9F2CN2MsY6B+H37WZAO9PlQZwdC4eVuVJz25hk/C5pou612tsxB/XOfc CNQJPgp7YR5Hm53HTRwjRC6ea+u/kDmmO4kiWcV2yr/n535+yLOvXf6X82Ncrq/g8x7T0/svt0KcH uJqNL21QhoC5eYHUmRL7thetxjDS3pcbLKnxdER1JqvMyQ6cUPVPZdzwnIjWPo3EBo0K1r+69TVPG yelBPgmksvMugV6gD3rWvA==; In-Reply-To: (message from Stefan Monnier on Fri, 15 Nov 2024 15:45:46 -0500) 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:295441 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , 74339@debbugs.gnu.org > Date: Fri, 15 Nov 2024 15:45:46 -0500 > > > Here is a section of a test file sent to bug-cc-mode some while ago: > > > > /* > > ** Local Variables: > > ** mode:c > > ** indent-tabs-mode:nil > > ** c-basic-offset:4 > > ** End: > > */ > > > > Here it is evident that by "mode:c" the OP means C Mode, not whatever > > random mode happens to have taken the symbol `c-mode'. > > It is evident that the OP means CC-mode's C Mode because the bug report > is sent to `bug-cc-mode`, indeed. Perhaps we should introduce (on master) a boolean variable to disable mode remapping? Then files which want to force a mode could specify that. > >> If you really insist, we can add > >> (add-to-list 'major-mode-remap-defaults '(c-ts-mode . c-mode)) > >> (add-to-list 'major-mode-remap-defaults '(c++-ts-mode . c++-mode)) > >> to your `cc-mode.el` together with corresponding removals in > >> `c-ts-mode.el`, even though in my book file-local settings of > >> `mode: c-ts-mode` in non-personal files are just bugs. > > The problem is that entries in major-mode-remap-defaults (and the other > > one) do not accurately represent user preferences. > > Entries in `major-mode-remap-defaults` indeed do not reflect > a user preference, just a "circumstantial" preference. > > [ Ideally, they shouldn't be set just by loading a file (whether > `cc-mode.el` or `c-ts-mode.el`). But after a long protracted > discussion the Emacs maintainers decided that it was the least bad > choice in Emacs-29. This may be revisited in the future, e.g. for > Emacs-31, but AFAICT it's too late to make such a change in > Emacs-30. ] yes, it's too late to change this for Emacs 30. So Emacs 30 will make only a half-step in this direction. > But entries in `major-mode-remap-alist` very much reflect a user preference. Yes. I have now added to the Emacs user manual explicit advice to customize that to express user's firm preferences that override any "internally-motivated" mode remapping. > > I haven't looked just yet, but can I assume there's a recipe in the > > Emacs 30 NEWS file telling users how to switch between old behaviour > > (-*- c -*- always means C mode) and new behaviour (-*- c -*- can mean > > c-ts-mode depending on other settings)? > > If anything, Emacs-30 makes it easier than Emacs-29: > > (add-to-list 'major-mode-remap-alist '(c-mode)) This is now in NEWS and in the manual.