unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Turning on minor modes in File Variables
@ 2011-06-07 17:06 Michael Heerdegen
  2011-06-07 18:22 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Heerdegen @ 2011-06-07 17:06 UTC (permalink / raw)
  To: emacs-devel

Hello

There was a plan to make minor modes always turn on if invoked
interactively without prefix arg (Subject "turning on minor modes from
hooks", 2009 in emacs-devel).  What's the current state there?

I guess there wasn't any change, `define-minor-mode' in `easy-mmode.el'
in trunk looks unchanged.


I ask because if I want to turn on a mode automatically in a file, like
this:


;; Local Variables:
;; mode: TeX-PDF
;; End:


Then the mode will actually being turned off if it was already enabled
(in my example it is already enabled because I use
`TeX-global-PDF-mode').

I think that's not what the user expects.  At least, the Info pages in
my Emacs 23.3 (Customization > Variables > File Variables > Specifying
File Variables) say

   Some "variable names" have special meanings in a local variables
list:

   * `mode' enables the specified major or minor mode.

[...]



Michael.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Turning on minor modes in File Variables
  2011-06-07 17:06 Turning on minor modes in File Variables Michael Heerdegen
@ 2011-06-07 18:22 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2011-06-07 18:22 UTC (permalink / raw)
  To: michael_heerdegen; +Cc: emacs-devel

> There was a plan to make minor modes always turn on if invoked
> interactively without prefix arg (Subject "turning on minor modes from
> hooks", 2009 in emacs-devel).  What's the current state there?

This change has been implemented for Emacs-24, tho it only applies to
minor modes defined with define-minor-mode.

> I guess there wasn't any change, `define-minor-mode' in `easy-mmode.el'
> in trunk looks unchanged.

Look again.

> ;; Local Variables:
> ;; mode: TeX-PDF
> ;; End:

You can also do

  ;; eval: (TeX-PDF-mode 1)

which should work everywhere.  It may/will prompt, but in Emacs-24 this
has been changed so that `eval' doesn't prompt for such calls to enable
minor modes.


        Stefan



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-07 18:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-07 17:06 Turning on minor modes in File Variables Michael Heerdegen
2011-06-07 18:22 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).