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" <bug-gnu-emacs@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#74339: 30.0.92; CC Mode stomps C TS Mode
Date: Wed, 13 Nov 2024 17:57:55 -0500
Message-ID: <jwvy11mlpm6.fsf-monnier+emacs@gnu.org>
References: <868qtnfd2d.fsf@gnu.org> <ZzT2uf_kwdveTv6e@MAC.fritz.box>
 <86r07elwoh.fsf@gnu.org> <ZzUpa5mQlsDhy_9D@MAC.fritz.box>
Reply-To: Stefan Monnier <monnier@iro.umontreal.ca>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="18480"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cc: Eli Zaretskii <eliz@gnu.org>, 74339@debbugs.gnu.org
To: Alan Mackenzie <acm@muc.de>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 13 23:59:32 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1tBMKh-0004dO-Lq
	for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Nov 2024 23:59:31 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1tBMKI-0000uR-9H; Wed, 13 Nov 2024 17:59: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 <Debian-debbugs@debbugs.gnu.org>)
 id 1tBMKE-0000uI-Vg
 for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2024 17:59: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 <Debian-debbugs@debbugs.gnu.org>)
 id 1tBMKE-0001Ri-Ff
 for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2024 17:59: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=4k090tXnqkKUZX66/4P9i9FWiaCgaeG+hxz4+wQP6t4=; 
 b=TO1BcSEkPIw0Y4Yw8cD76E1e9mBdW8W09AE8FVSlSRevZVGQ/Dv0qN/rDs7EUDlJTedbvWAkgZ7TclXPxzsQxOMpKmkKZH+NtzBXUBwLI+4XWQiGI9I1QCb1g7m4kjWRtpikLTxkqyXT7J9VYKR8AsZ5jB6bVVMn0nychtJJ8lriZ/bvVGHku2mwJz1iatg6EJLyLTskGDW+ySReNsDEBxNqs3eYkIEpfEj4XWdXGjcVyEqSmLVO000BIsgbvNl89HMuW+pb/0HrLBXtcLSIJ40DtlW89X3q0If/AH5EvQsRRjkCD3jyPWuESNqWDmPXk0hMAeTzCXPGInK13dGqeg==;
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tBMKE-00087N-1W
 for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2024 17:59:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Stefan Monnier <monnier@iro.umontreal.ca>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Wed, 13 Nov 2024 22:59:01 +0000
Resent-Message-ID: <handler.74339.B74339.173153868631132@debbugs.gnu.org>
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.173153868631132
 (code B ref 74339); Wed, 13 Nov 2024 22:59:01 +0000
Original-Received: (at 74339) by debbugs.gnu.org; 13 Nov 2024 22:58:06 +0000
Original-Received: from localhost ([127.0.0.1]:44055 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1tBMJJ-000863-V4
 for submit@debbugs.gnu.org; Wed, 13 Nov 2024 17:58:06 -0500
Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58670)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@iro.umontreal.ca>) id 1tBMJI-00085X-03
 for 74339@debbugs.gnu.org; Wed, 13 Nov 2024 17:58:04 -0500
Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2107D444AFF;
 Wed, 13 Nov 2024 17:57:57 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1731538676;
 bh=DZTX8oMQIh9OQ0HCM+ipBqpnkRvpn31fOTlkTmIakKY=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=OqMPOutHbARjF35dTLbfy6zqyoEZqhc5XL7Ykk4U9F2IsljL7z47EcQf4MEdLA5dJ
 swr/L7yF9yU6EUms06NV6kG3msumpApt3kFjHPkOk9zTjbEYcfQa1paCZK40eynXRz
 iyuf7XhPONv5TU/WHyEXG/piTp8MgaOTI7SVy69stRDEOx11g4t0VBdkz4F7cG9hiE
 1pDyj2vS4d8WFnf04K2dzAGeHrkBnaCtpmDmN5tNZkn7hajwHhyhutRz11HEcJRBZr
 mzWAaKiqtsSQUISi3onwech6t04LW1NRSE759RkbcpKvZZQ4vVFgl1+D3WbZ0ZmU6U
 Var6BVReRsHpQ==
Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EBEC7444AFC;
 Wed, 13 Nov 2024 17:57:55 -0500 (EST)
Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D3C0A120176;
 Wed, 13 Nov 2024 17:57:55 -0500 (EST)
In-Reply-To: <ZzUpa5mQlsDhy_9D@MAC.fritz.box> (Alan Mackenzie's message of
 "Wed, 13 Nov 2024 22:34:19 +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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:295297
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/295297>

>> When the user expresses her desire to use c-ts-mode, Emacs arranges for
>> C files to use c-ts-mode.  That's what users expect from Emacs when
>> they express their preferences.
> Yes, and if the said user wants to go back to C Mode, she should be able
> to.  Before my patch this was difficult.

It was (and still is) a small matter of configuring `major-mode-remap-alist`.

> Anybody wishing to use c-ts-mode can use it, by use of the symbol
> `c-ts-mode'.

In order to work on all C files, this is done by ... configuring
`major-mode-remap-alist`.

Not sure why you say one of them is "difficult" but not the other.

>> The symbol was not misused.  The implementation of the user's
>> preference to use c-ts-mode was via major-mode remapping, that's all.
> The user expressing preference by setting major-mode-remap-alist was
> unaffected by my patch.

Indeed, and I think we should help the users add such a setting rather
than have them depend on unreliable defaults which depend on which file
is loaded or not or when.

> When the user wants c-ts-mode she should be able to use the symbol
> `c-ts-mode', somehow.  Likewise for C Mode and `c-mode'.  If some user
> adds an entry to auto-mode-alist with `c-mode' in its cdr, do you really
> think it correct to start c-ts-mode?  Because that was the state of Emacs
> -Q before my patch.

Really?  I find that hard to believe when reading the code.
AFAICT, in `emacs -Q` `major-mode-remap-defaults` is:

    ((LaTeX-mode . latex-mode) (plain-TeX-mode . plain-tex-mode)
     (TeX-mode . tex-mode))

and `auto-mode-alist` maps `.c` files to `c-mode` so I can't see how and
why a C file would be put into `c-ts-mode` without some explicit action
on the part of the user.

> Don't you agree something needs to be fixed, there?

I agree what you describe would be a bug, but I think there's something
missing in your description.

[ Sorry, that's all for now, I didn't have time yet to finish your message.  ]


        Stefan