unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4148: mode: for a minor mode should turn on, not toggle the mode
@ 2009-08-15 17:40 Chong Yidong
  2009-08-15 18:54 ` Dan Nicolaescu
  0 siblings, 1 reply; 5+ messages in thread
From: Chong Yidong @ 2009-08-15 17:40 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 4148

> A well known long standing problem:
> using 
> mode: SOME_MINOR_MODE

> in a local variable section (or in .dir-locals.el) toggles the minor
> mode, it should turn it on.

> So if the user sets a hook to turn on the minor mode in her emacs, when
> using a file that sets the same minor mode, the minor mode ends up being
> disable.

Does this patch DTRT?

*** trunk/lisp/files.el.~1.1066.~	2009-08-14 19:37:09.000000000 -0400
--- trunk/lisp/files.el	2009-08-15 13:37:24.000000000 -0400
***************
*** 3189,3195 ****
  				     "-mode"))))
  	   (unless (eq (indirect-function mode)
  		       (indirect-function major-mode))
! 	     (funcall mode))))
  	((eq var 'eval)
  	 (save-excursion (eval val)))
  	(t
--- 3189,3199 ----
  				     "-mode"))))
  	   (unless (eq (indirect-function mode)
  		       (indirect-function major-mode))
! 	     (if (memq mode minor-mode-list)
! 		 ;; For a minor mode, enable unconditionally instead
! 		 ;; of toggling (since the mode may already be on).
! 		 (funcall mode 1)
! 	       (funcall mode)))))
  	((eq var 'eval)
  	 (save-excursion (eval val)))
  	(t






^ permalink raw reply	[flat|nested] 5+ messages in thread
* bug#4148: mode: for a minor mode should turn on, not toggle the mode
@ 2009-08-15  7:05 Dan Nicolaescu
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Nicolaescu @ 2009-08-15  7:05 UTC (permalink / raw)
  To: bug-gnu-emacs


A well known long standing problem:
using 
mode: SOME_MINOR_MODE

in a local variable section (or in .dir-locals.el) toggles the minor
mode, it should turn it on.

So if the user sets a hook to turn on the minor mode in her emacs, when
using a file that sets the same minor mode, the minor mode ends up being
disable.






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

end of thread, other threads:[~2009-08-17  1:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-15 17:40 bug#4148: mode: for a minor mode should turn on, not toggle the mode Chong Yidong
2009-08-15 18:54 ` Dan Nicolaescu
2009-08-17  1:09   ` Chong Yidong
2009-08-17  1:49     ` Dan Nicolaescu
  -- strict thread matches above, loose matches on Subject: below --
2009-08-15  7:05 Dan Nicolaescu

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