changeset 91471:13eacee3408e

(global-whitespace-mode): Revert last change. (whitespace-unload-function): Force `global-whitespace-mode' to deactivate local modes in a slightly less intrusive way.
author Juanma Barranquero <lekktu@gmail.com>
date Sat, 02 Feb 2008 17:41:55 +0000
parents 9a247ca132c4
children 93fcec3a4fd7
files lisp/whitespace.el
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/whitespace.el	Sat Feb 02 17:35:23 2008 +0000
+++ b/lisp/whitespace.el	Sat Feb 02 17:41:55 2008 +0000
@@ -928,9 +928,7 @@
       (remove-hook 'find-file-hook 'whitespace-turn-on-if-enabled)
       (dolist (buffer (buffer-list))	; adjust all local mode
 	(set-buffer buffer)
-	(when (or (not whitespace-mode)
-		  ;; whitespace is being unloaded
-		  (bound-and-true-p unload-function-defs-list))
+	(unless whitespace-mode
 	  (whitespace-turn-off)))))))
 
 
@@ -1758,7 +1756,8 @@
 
 (defun whitespace-unload-function ()
   "Unload the Whitespace library."
-  (global-whitespace-mode -1)
+  (let (whitespace-mode) ;; so g-w-m thinks it is nil in all buffers
+    (global-whitespace-mode -1))
   ;; continue standard unloading
   nil)