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:58:52 +0200 Message-ID: <86serthqrn.fsf@gnu.org> References: <868qtnfd2d.fsf@gnu.org> <86r07elwoh.fsf@gnu.org> <86h68al2qz.fsf@gnu.org> <8634jtk4gj.fsf@gnu.org> <86y11limbr.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19002"; 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 Fri Nov 15 09:00:30 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 1tBrFk-0004j9-K2 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Nov 2024 09:00:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBrFO-0005lm-Fh; Fri, 15 Nov 2024 03:00:06 -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 1tBrFM-0005ld-MO for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 03:00:04 -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 1tBrFL-00055n-LP for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 03:00: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=1jxt4bIkh1o0qFQPzbsDHk7UvLacW4vRJFM3mturUL4=; b=iSHoCp1co8L7ECK62pXidJWutSmRVY23fc714BZIXnEcRBcNwM03dDA6FECsiKKfPjshzGLxO4KqYLp3cP/1ESbIr/gGB/M7Qwn44DpjIVOKpue7ymg7jsAW2n0CvHR/Lq77zcjVYOS3x+Ji7Clc5uS80JZVV3UCaVoRD192R77yGTorGWDDKC7HTTAqo2PJpobNsU9iswiYh1Mz4c2HS4YGUFVZBIHypUq6wLB0TuMO8JobmKz/KTadBQzFU40xWdI34lSQtD5kFnmob84w8QeeC7hb2Ctvj5n7JCIXIM1+RPmo68cFm3z1dFgVvPmHg7jO9a8DGo7c3f5COojeQw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBrFL-0007Se-6Q for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 03:00:03 -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 08:00:03 +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.173165754528578 (code B ref 74339); Fri, 15 Nov 2024 08:00:03 +0000 Original-Received: (at 74339) by debbugs.gnu.org; 15 Nov 2024 07:59:05 +0000 Original-Received: from localhost ([127.0.0.1]:48423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBrEO-0007Qs-MT for submit@debbugs.gnu.org; Fri, 15 Nov 2024 02:59:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBrEM-0007QP-RZ for 74339@debbugs.gnu.org; Fri, 15 Nov 2024 02:59:03 -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 1tBrEF-0004zb-Vd; Fri, 15 Nov 2024 02:58:55 -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=1jxt4bIkh1o0qFQPzbsDHk7UvLacW4vRJFM3mturUL4=; b=Tei3eUKm09r7 zqy6Mon2zIXKYva4xItxXiAV/oUj+sKnONOr1qsft1NdUyXzvvkSaN2u5molWHeL6sUkRZiB6kDoy 2GWRa2iTBIYbgnxqOCxEkL+wUXsVYvej4Ui2z8o7Kqp489s+/r+e9cmNLLdUUQa0+OLz+vwO3Fw+a jQspmpzgzEsvMV5jMQhxsWw0Cu9wE2OFfUGAvbtRzMIw48XXbcWrO0H8Nn2393Uq88narWAcFhfSK FmY3fccUPVrOBKGbUYhADqMkp2l0VVNIWsef3U0SPEuQY07yuNWM48VjTGi0Jme25EtO58z6Wzg96 W+048WayrIlRQ1QO8BQt8Q==; In-Reply-To: (message from Stefan Monnier on Thu, 14 Nov 2024 15:58:49 -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:295384 Archived-At: > From: Stefan Monnier > Cc: acm@muc.de, 74339@debbugs.gnu.org > Date: Thu, 14 Nov 2024 15:58:49 -0500 > > >> >> Not quite: `auto-mode-alist` should always map `.c` files to `c-mode`. > >> > Why "always"? > >> > >> Because the preference between `c-mode` and `c-ts-mode` should apply not > >> only to those files whose mode is decided by `auto-mode-alist` but also > >> to those where this is decided via other means such as via a file-local > >> `mode` setting, or via `magic-mode-alist`, or ... > > > > You assume that people will always want to remap all of those to the > > same mode? > > Not always but in the vast majority of cases, yes. > > > And that no one will ever want to have, say, files with the -*- c -*- > > cookie to use c-mode and nothing else? Some might, even if the > > majority won't. > > Those few who want that can still get it: just config > `major-mode-remap-alist` to remap `c-mode` to `c-mode` (or to nil), and > then things work as if `major-mode-remap-*` didn't exist: `-*- c -*-` > will mean to use CC-mode's `c-mode` and `-*- c-ts -*-` will use > `c-ts-mode`. This will cause Emacs to visit C files without the cookie in c-mode. What I meant was an (admittedly somewhat strange) preference to visit C files without a cookie in c-ts-mode, but files that have a cookie in the mode called out by the cookie. AFAIU, major-mode-remap-* variables cannot handle this distinction, at least not currently.