Subject: bug#2355: 23.0.60; Enabling minor-mode disables major mode

From: Leo <[email-masked]>
Date: Wed, 18 Feb 2009 07:42:35 +0000

On 2009-02-17 16:43 +0000, Juanma Barranquero wrote:
>> Sorry I was not clear. I am questioning whether the different
>> behaviour between these two ways of specifying local variables is a
>> bug or not. In my view, it is confusing at least.
>
> Mode autodetection is complex (there are file variables,
> interpreter-mode-alist, magic-mode-alist, magic-fallback-mode-alist,
> etc.). It is not impossible to get nonsense (or, at least, unexpected)
> results when given inconsistent input data. It would perhaps be better
> to detect when a supposed major mode (found with -*-, auto-mode-alist
> or whatever) is not really setting major-mode, but that's another bug
> ;-)

But we are only talking about file variables in this case. There are two
ways of specifying file variables: in the header and at the end of the
file. 

When they contain the pseudo-variable mode specifying a minor mode, they
behave differently.

The two behaviours are as follows.

1. put file in fundamental mode and the minor mode (when in header)
2. put file in a major mode by auto mode detection and the minor mode
   (when at the end of file)

This causes confusion. Do you think this is a bug? If not, I think at
least the manual can be improved.

Thanks,
-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .: I use Emacs :.