diff options
| author | Juanma Barranquero | 2008-02-01 11:25:16 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2008-02-01 11:25:16 +0000 |
| commit | 1e2b96c2b8293359fca97b7842838032e8ad20f6 (patch) | |
| tree | dfb8de4df4e962859b567ae5e0ebe26211503738 | |
| parent | acaf02dd139b5b84e598b85f5772be6876d01dfb (diff) | |
| download | emacs-1e2b96c2b8293359fca97b7842838032e8ad20f6.tar.gz emacs-1e2b96c2b8293359fca97b7842838032e8ad20f6.zip | |
(global-whitespace-mode): When turning off the global mode,
turn off the local modes too if whitespace is being unloaded.
(whitespace-unload-function): New function.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/whitespace.el | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7e418a35721..b2a131b2b76 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,6 +1,9 @@ | |||
| 1 | 2008-02-01 Juanma Barranquero <lekktu@gmail.com> | 1 | 2008-02-01 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 2 | ||
| 3 | * whitespace.el (global-whitespace-mode): Fix modeline lighter. | 3 | * whitespace.el (global-whitespace-mode): Fix modeline lighter. |
| 4 | When turning off the global mode, turn off the local modes too | ||
| 5 | if whitespace is being unloaded. | ||
| 6 | (whitespace-unload-function): New function. | ||
| 4 | 7 | ||
| 5 | 2008-02-01 Thien-Thi Nguyen <ttn@gnuvola.org> | 8 | 2008-02-01 Thien-Thi Nguyen <ttn@gnuvola.org> |
| 6 | 9 | ||
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index e3ce8a4dc27..4615e28b97f 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -931,7 +931,9 @@ Only useful with a windowing system." | |||
| 931 | (remove-hook 'find-file-hooks 'whitespace-turn-on-if-enabled)) | 931 | (remove-hook 'find-file-hooks 'whitespace-turn-on-if-enabled)) |
| 932 | (dolist (buffer (buffer-list)) ; adjust all local mode | 932 | (dolist (buffer (buffer-list)) ; adjust all local mode |
| 933 | (set-buffer buffer) | 933 | (set-buffer buffer) |
| 934 | (unless whitespace-mode | 934 | (when (or (not whitespace-mode) |
| 935 | ;; whitespace is being unloaded | ||
| 936 | (bound-and-true-p unload-function-defs-list)) | ||
| 935 | (whitespace-turn-off))))))) | 937 | (whitespace-turn-off))))))) |
| 936 | 938 | ||
| 937 | 939 | ||
| @@ -1757,6 +1759,12 @@ options are valid." | |||
| 1757 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1759 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 1758 | 1760 | ||
| 1759 | 1761 | ||
| 1762 | (defun whitespace-unload-function () | ||
| 1763 | "Unload the Whitespace library." | ||
| 1764 | (global-whitespace-mode -1) | ||
| 1765 | ;; continue standard unloading | ||
| 1766 | nil) | ||
| 1767 | |||
| 1760 | (provide 'whitespace) | 1768 | (provide 'whitespace) |
| 1761 | 1769 | ||
| 1762 | 1770 | ||