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  7:05 ` Dan Nicolaescu
  2009-08-20 20:30   ` bug#4148: marked as done (mode: for a minor mode should turn on, not toggle the mode) Emacs bug Tracking System
  0 siblings, 1 reply; 6+ 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] 6+ messages in thread

* 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; 6+ 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] 6+ messages in thread

* bug#4148: mode: for a minor mode should turn on, not toggle the mode
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Nicolaescu @ 2009-08-15 18:54 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 4148

Chong Yidong <cyd@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?





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

* bug#4148: mode: for a minor mode should turn on, not toggle the mode
  2009-08-15 18:54 ` Dan Nicolaescu
@ 2009-08-17  1:09   ` Chong Yidong
  2009-08-17  1:49     ` Dan Nicolaescu
  0 siblings, 1 reply; 6+ messages in thread
From: Chong Yidong @ 2009-08-17  1:09 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 4148

Dan Nicolaescu <dann@ics.uci.edu> writes:

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

I'm having trouble coming up with a test-case for testing this patch.
Do you have one?





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

* bug#4148: mode: for a minor mode should turn on, not toggle the mode
  2009-08-17  1:09   ` Chong Yidong
@ 2009-08-17  1:49     ` Dan Nicolaescu
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Nicolaescu @ 2009-08-17  1:49 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 4148

Chong Yidong <cyd@stupidchicken.com> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > 
  > > 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?
  > 
  > I'm having trouble coming up with a test-case for testing this patch.
  > Do you have one?

Here's one:

$ cat foo.el
(add-hook 'change-log-mode-hook (lambda () (bug-reference-mode 1)))

$ cat emacs/.dir-locals.el

((nil . ((tab-width . 8)
         (fill-column . 70)))
 (c-mode . ((c-file-style . "GNU")))
 (text-mode . ((mode . auto-fill)))
 (change-log-mode . ((add-log-time-zone-rule . t)
                     (fill-column . 74)
                     (bug-reference-url-format
                      . "http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=%s")
                     (mode . bug-reference))))

;; arch-tag: fb93c160-e9fe-4184-aad1-e4f5daa11cbd


$ emacs -Q -l foo.el
C-x C-f emacs/lisp/ChangeLog

C-h v bug-reference-mode RET

before your patch bug-reference-mode is nil, after it's t






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

* bug#4148: marked as done (mode: for a minor mode should turn on, not toggle the mode)
  2009-08-15  7:05 ` bug#4148: mode: for a minor mode should turn on, not toggle the mode Dan Nicolaescu
@ 2009-08-20 20:30   ` Emacs bug Tracking System
  0 siblings, 0 replies; 6+ messages in thread
From: Emacs bug Tracking System @ 2009-08-20 20:30 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 916 bytes --]

Your message dated Mon, 17 Aug 2009 19:51:39 -0400
with message-id <87prauhud0.fsf@stupidchicken.com>
and subject line Re: bug#4148: mode: for a minor mode should turn on, not toggle the mode
has caused the Emacs bug report #4148,
regarding mode: for a minor mode should turn on, not toggle the mode
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4148: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4148
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3116 bytes --]

From: Dan Nicolaescu <dann@ics.uci.edu>
To: bug-gnu-emacs <bug-gnu-emacs@gnu.org>
Subject: mode: for a minor mode should turn on, not toggle the mode
Date: Sat, 15 Aug 2009 00:05:26 -0700 (PDT)
Message-ID: <200908150705.n7F75QHF004092@godzilla.ics.uci.edu>


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.



[-- Attachment #3: Type: message/rfc822, Size: 2053 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: 4148-done@emacsbugs.donarmstrong.com
Subject: Re: bug#4148: mode: for a minor mode should turn on, not toggle the mode
Date: Mon, 17 Aug 2009 19:51:39 -0400
Message-ID: <87prauhud0.fsf@stupidchicken.com>

Dan Nicolaescu <dann@ics.uci.edu> writes:

>   > I'm having trouble coming up with a test-case for testing this patch.
>   > Do you have one?
>
> Here's one:

Thanks.  I've checked in the patch.

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

end of thread, other threads:[~2009-08-20 20:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87prauhud0.fsf@stupidchicken.com>
2009-08-15  7:05 ` bug#4148: mode: for a minor mode should turn on, not toggle the mode Dan Nicolaescu
2009-08-20 20:30   ` bug#4148: marked as done (mode: for a minor mode should turn on, not toggle the mode) Emacs bug Tracking System
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

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