GNU bug report logs - #4148
mode: for a minor mode should turn on, not toggle the mode

Previous Next

Package: emacs;

Reported by: Dan Nicolaescu <dann <at> ics.uci.edu>

Date: Sat, 15 Aug 2009 07:15:04 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 4148 <at> debbugs.gnu.org
Subject: bug#4148: mode: for a minor mode should turn on, not toggle the mode
Date: Sat, 15 Aug 2009 11:54:28 -0700 (PDT)
Chong Yidong <cyd <at> stupidchicken.com> writes:

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

Thanks, it seems to work fine.

After this gets checked in, we can re-add (mode . bug-reference) to emacs/.dir-locals.el

Any chance this patch can get onto the next release branch?



This bug report was last modified 15 years and 280 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.