From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74339: 30.0.92; CC Mode stomps C TS Mode Date: Fri, 15 Nov 2024 14:01:26 -0500 Message-ID: References: <867c95kaye.fsf@gnu.org> <861pzdk4aq.fsf@gnu.org> <86zfm1in2p.fsf@gnu.org> <86wmh5hrya.fsf@gnu.org> <86cyiwimlr.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10289"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 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 20:02:21 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 1tC1aG-0002aJ-VH for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Nov 2024 20:02:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC1a1-0006dv-0v; Fri, 15 Nov 2024 14:02:05 -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 1tC1Zy-0006dk-Mj for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 14:02: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 1tC1Zy-0006vk-DC for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 14:02:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=mnGaI1FVpC2FSZrele+PWyF8zFB2ViAJg3ymPkhk+zg=; b=q0g2Dn9bd9mukVaS4MJvznIOcQKxRuGL+3B4m9nM4gChlUnFEisT5WYX893W5wqAo1tVLhC6G9En3xiO9PVydSdWndlAVJOe243AsGDwwiYASNYBMtVG+uoJ5lzBx+FJe5tJAtVjGJoYS8ObYXb8asYlGXAOddPKyWs/nsHZhgg1JK2NWqkmRo9Jj09qs55GvBAh+28NEhwZvft4gQZAJEuSlJpNspG1By7KEALl4gMlzvEW+/bjEWytd8xv21yhuNqaekyEFttE9p3C1OOZHH11Yy3xNeioVv1MgR/HHtBSyj4qC44fDC34R0fANGf/IHGYxs/f2wxCgrSGunURnQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tC1Zy-0002wh-7k for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 14:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Nov 2024 19:02: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.173169730311292 (code B ref 74339); Fri, 15 Nov 2024 19:02:02 +0000 Original-Received: (at 74339) by debbugs.gnu.org; 15 Nov 2024 19:01:43 +0000 Original-Received: from localhost ([127.0.0.1]:50868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tC1Zf-0002w4-7W for submit@debbugs.gnu.org; Fri, 15 Nov 2024 14:01:43 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:49100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tC1Zd-0002vr-HO for 74339@debbugs.gnu.org; Fri, 15 Nov 2024 14:01:41 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 72F2D100126; Fri, 15 Nov 2024 14:01:35 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1731697294; bh=DMaPqLAxiSjbYquYCrEcBdlsqXrCOJJO2Xd4Ox2ZsBQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WEUZaBWPcZVptvPOU5KlXzXavo1etGzMKR2My8AeTERVpXEYE9zIdrsBTengN+yDa VnzTP4snTiyhXtoBzjiucYpktXHa46hp8CF7H1cX4uGtRRqnUMlV5eFvYxJS1YlCyi amtAKTh+JXvJjhEkxv5ACTNyJuxEst2/xpMEZm3iiC3TfngpgvWtco887AqKNjqATs YT6W1ZLGPgFMAmIdjpvJJvtvlr+9bE5QXTH3kTTjd0LxLgan5gZ8BVLE+466doGN94 LZFeZy9KddSZrH/80z04/qQsxPm4ZCcPKopT3FRSRoWOcpIlWc9Y5BdEUiXudpTt1f 9+XTBXJSlPJoQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id AB984100055; Fri, 15 Nov 2024 14:01:34 -0500 (EST) Original-Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7FEBE1201DA; Fri, 15 Nov 2024 14:01:34 -0500 (EST) In-Reply-To: (Alan Mackenzie's message of "Fri, 15 Nov 2024 17:58:35 +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:295411 Archived-At: > One can write, in the Local Variables: section > > mode: c-ts FWIW, unless this file is personal, this is very bad practice, and not only because `c-ts-mode` may not be available (in older Emacsen or if the user didn't build Emacs with tree-sitter support or doesn't have the appropriate grammar installed): the choice between `c-mode` and `c-ts-mode` is a personal preference, so it's not the file's business to tell the user which mode to use, just like it's not the file's business to tell the user which editor to use. There might be special situations where such a setting might be warranted, but they're sufficiently hypothetical or rare that they should not drive our decisions, as long as the users can still get the behavior they want in such cases (which they can, regardless of what we do with `major-mode-remap-defaults`). > .. This will cause the buffer to start in c-ts-mode regardless of any > other current settings. Actually, no: `major-mode-remap-*` can also remap `c-ts-mode` to some other mode, such as `c-mode`. > .. When that line is followed by setting other CC Mode variables (as is > surely common for any such use of the major mode setting) that will > signal some sort of error on opening the buffer, should c-mode have been > "remapped" to c-ts-mode. Or if it doesn't do that, those local variables > will be disregarded. This is a Bad Thing. 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. > ... there will be no way for a user to specify c-mode unambiguously ... Where/when? AFAICT the only case where this might be true are the cases where it does not do any damage. > OK, thanks. He is proposing that the meaning of -*- c -*-, `c-mode' > as used in normal-mode, etc., should, from the user's point of view, > be changed in an opt-out fashion. He is proposing that there be no > way to specify C Mode in a local variables section. Such changes > should be opt-in, not opt-out. They would certainly need an entry in > NEWS. if there's not already one there. It is supposed to opt-in, indeed. Stefan