emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subversion of user chosen major mode by Emacs.


From: Alan Mackenzie
Subject: Re: Subversion of user chosen major mode by Emacs.
Date: Wed, 29 May 2024 12:51:52 +0000

Hello, Dmitry.

On Wed, May 29, 2024 at 14:43:29 +0300, Dmitry Gutov wrote:
> On 29/05/2024 14:16, Alan Mackenzie wrote:
> >> I think this is a misfeature of `c-ts-mode.el`, but this was the result
> >> of a long discussion and I don't think we want to revisit that yet.
> > Why did nobody involve me in this discussion, considering that the
> > result involves "stealing" CC Mode users?

> This behavior is not new: loading a *-ts-mode has been overriding the 
> user preferences since 2023-01-20 (commit 6b2f85caa6).

That has nothing to do with my point it is supposedly answering.

I've just had a look at that commit, and it simply adds entries to
auto-mode-alist for the *-ts-mode modes in the traditional, normal and
acceptable fashion.  CC Mode does the same.

The problem comes in a comment in that patch encouraging users to
subvert the proper meaning of c-mode, etc., from being specific modes to
being vague generic modes.  This is completely unnecessary for the
normal user who uses only the *-ts- modes and not CC Mode.  It is a
confusing mess for users who wish to use both of these, say for
comparison.

> Perhaps your personal customization for auto-mode-alist had been 
> shielding you from the original issue. You can add a similar entry to 
> major-mode-remap-alist.

Not sure what "original issue" you're referring to.  My customisation
for auto-mode-alist is an eval-after-load for c-ts-mode which deletes
the *-ts- entries from auto-mode-alist.  This has worked fine until
recently and should be restored to working again.

All this confusion in auto-mode-alist, and the horrible workarounds of
major-mode-remp_\(alist\|defaults\) result from a fundamental conceptual
error, namely changing c-mode and friends from having specific meanings
to being vague generic symbols.  THIS is what I should have been
consulted about, as the owner of these symbols.

The latest symptom of this misunderstanding, which I bumped into
yesterday, is that Emacs changes the major mode of a C buffer with M-x
revert-buffer.  This is clearly unacceptable.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]