Subject: bug#74339: 30.0.92; CC Mode stomps C TS Mode

From: Eli Zaretskii <[email-masked]>
Date: Fri, 15 Nov 2024 10:13:25 +0200

> From: Stefan Monnier <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
> Date: Thu, 14 Nov 2024 16:06:01 -0500
> 
> >> 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.
> 
> For `major-mode-remap-defaults`, mapping `c-mode` to `c-mode` behaves
> the same as when there is simply no entry mapping `c-mode` to anything,
> which is why the code I suggested (which just removes any previous
> remapping of `c-mode`) should give the same result as what you describe.

That's true, but only if the other elements whose car is c-mode were
first removed with 110% reliability.  If we want to be absolutely sure
that c-mode spec invokes c-mode and nothing else, adding '(c-mode) is
more reliable.

> The apparent asymmetry is compensated by the fact that the entries in
> `auto-mode-alist` always say `c-mode` and never `c-ts-mode`, so there's
> never a need to remap `c-ts-mode` to `c-mode`.

Right.