2008-02-01 Juanma Barranquero <lekktu@gmail.com>
* whitespace.el (global-whitespace-mode): Fix modeline lighter.
+ When turning off the global mode, turn off the local modes too
+ if whitespace is being unloaded.
+ (whitespace-unload-function): New function.
2008-02-01 Thien-Thi Nguyen <ttn@gnuvola.org>
(remove-hook 'find-file-hooks 'whitespace-turn-on-if-enabled))
(dolist (buffer (buffer-list)) ; adjust all local mode
(set-buffer buffer)
- (unless whitespace-mode
+ (when (or (not whitespace-mode)
+ ;; whitespace is being unloaded
+ (bound-and-true-p unload-function-defs-list))
(whitespace-turn-off)))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun whitespace-unload-function ()
+ "Unload the Whitespace library."
+ (global-whitespace-mode -1)
+ ;; continue standard unloading
+ nil)
+
(provide 'whitespace)