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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 16 Nov 2024 11:52:53 +0200

> Date: Fri, 15 Nov 2024 19:46:03 +0000
> Cc: Eli Zaretskii <[email-masked]>, [email-masked], [email-masked]
> From: Alan Mackenzie <[email-masked]>
> 
> So, for a user trying out Emacs 30, with a desktop file containing at
> least one file with major mode c-ts-mode; visiting a file with the above
> Local Variables section will indeed start the buffer with C Mode?

No, it will turn on the mode specified in the desktop file.  And it is
not necessarily wrong: desktop.el restores the session as it was
before Emacs was shut down, so using the same major mode might be
exactly what the user expect.  (It could also be against user
expectations, which is why I think we need a user option to let users
control what desktop.el does in this case.)

> 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)?

There is now.

> Is the default to keep the old behaviour, as is customary with new
> features in Emacs?

Yes, as long as c-ts-mode was not loaded.  People who don't want to
depend on remapping caused by loading features or packages should
customize major-mode-remap-alist to express their preferences.