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

From: Juanma Barranquero <[email-masked]>
Date: Tue, 17 Feb 2009 17:43:49 +0100

On Tue, Feb 17, 2009 at 17:04, Leo <[email-masked]> wrote:

> Why is that an abuse? The manual does not specify what is not allowed.

"You can specify any number of variables/value pairs in this way, each
pair with a colon and semicolon as shown above.  `mode: MODENAME;'
specifies the major mode; this should come first in the line."

It does explicitly says that mode: specifies the major mode. It does
not say that it should not be a minor mode, but it also doesn't say
that you cannot use any arbitrary function (ending in -mode). If the
function that you use does not set major-mode, it will cause confusion
(to Emacs or the user, or both).

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

    Juanma