bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#7810: 24.0.50; global-whitespace-newline-mode impossible to turn off


From: Stefan Monnier
Subject: bug#7810: 24.0.50; global-whitespace-newline-mode impossible to turn off
Date: Mon, 10 Jan 2011 19:16:05 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

close 7810
thanks

> I start Emacs with the -Q switch.
> M-x global-whitespace-newline-mode RET
> (Global-Whitespace-Newline mode enabled)

> Then I want to turn it off:
> M-x global-whitespace-newline-mode RET
> (Global-Whitespace-Newline mode enabled)

> As you can see, it is still enabled. The mode line shows "Fundamental
> NL WS".

Indeed, under Emacs-23, it still worked, tho it returned a message
"Toggling global-whitespace-mode off; better pass an explicit argument".
I've installed the fix below in the emacs-23 branch, which should
fix it.


        Stefan


=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog      2011-01-10 20:36:09 +0000
+++ lisp/ChangeLog      2011-01-11 00:13:33 +0000
@@ -1,3 +1,8 @@
+2011-01-11  Stefan Monnier  <address@hidden>
+
+       * whitespace.el (global-whitespace-newline-mode): Fix call
+       to minor mode which used nil accidentally to mean "turn off".
+
 2011-01-10  Michael Albinus  <address@hidden>
 
        * net/tramp.el (tramp-find-inline-compress)

=== modified file 'lisp/whitespace.el'
--- lisp/whitespace.el  2011-01-02 23:50:46 +0000
+++ lisp/whitespace.el  2011-01-11 00:11:37 +0000
@@ -1188,7 +1188,8 @@
   :global     t
   :group      'whitespace
   (let ((whitespace-style '(newline-mark newline)))
-    (global-whitespace-mode global-whitespace-newline-mode)
+    (global-whitespace-mode (if global-whitespace-newline-mode
+                                1 -1))
     ;; sync states (running a batch job)
     (setq global-whitespace-newline-mode global-whitespace-mode)))
 






reply via email to

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