emacs-devel
[Top][All Lists]
Advanced

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

Re: dir-locals.el take precedence over user's mode-hook changes


From: Chetan Pandya
Subject: Re: dir-locals.el take precedence over user's mode-hook changes
Date: Wed, 31 Dec 2008 15:50:07 -0800 (PST)

--- On Wed, 12/31/08, Dan Nicolaescu <address@hidden> wrote:
> Stefan Monnier <address@hidden> writes:
> 
>   > > Unfortunately this does not work, it would turn the mode off if
>   > > it's already turned on.  
>   > 
>   > > If you have in your .emacs:
>   > 
>   > > (add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-hook)
>   > > (defun my-emacs-lisp-mode-hook ()  
> (auto-fill-mode 1))
>   > 
>   > > And add to an elisp file:
>   > 
>   > > ;; Local Variables:
>   > > ;; mode: auto-fill
>   > > ;; End:
>   > 
>   > > auto-fill-mode will not be turned on for that elisp file.
>   > 
>   > Yes, that's a more general problem.  I'd be inclined to change it so
>   > that the minor mode is unconditionally turned ON rather than toggled.
> 
> Please do that, this is a long standing issue...
Isn't this going against what the documentation says? Minor modes are supposed 
to be preferences and the user may or may not want those modes turned on 
automatically.

It looks like the first mode line entry is treated as major mode and the 
subsequent ones as minor mode. Specifying this in the local variables section 
has the potential to set the major mode twice - first using set-auto-mode and 
then when the local variables section is processed.

Given the problem with bug-reference-mode and such, it makes sense to change 
the way settings are processed. 

I have some ideas on this, but WDYT? (Obviously, there is a question of 
compatibility with existing behavior, but that doesn't seem to be a big issue 
with other features).

Chetan






reply via email to

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