Commit 6341c3fc authored by Juanma Barranquero's avatar Juanma Barranquero

(whitespace-write-file-hook): Remove interactive spec.

(whitespace-unload-function): New-style unload function.
If run, stop old style `-hook' function from running.
parent f5d47fb2
2007-10-31 Juanma Barranquero <lekktu@gmail.com>
* whitespace.el (whitespace-write-file-hook): Remove interactive spec.
(whitespace-unload-function): New-style unload function.
If run, stop old style `-hook' function from running.
* strokes.el (strokes-alphabetic-lessp): Doc fix.
2007-10-31 Sean O'Rourke <sorourke@cs.ucsd.edu>
......@@ -782,7 +782,6 @@ When this mode is active, `whitespace-buffer' is added to
(defun whitespace-write-file-hook ()
"Hook function to be called on the buffer when whitespace check is enabled.
This is meant to be added buffer-locally to `write-file-functions'."
(interactive)
(let ((werr nil))
(if whitespace-auto-cleanup
(whitespace-cleanup-internal)
......@@ -792,6 +791,18 @@ This is meant to be added buffer-locally to `write-file-functions'."
buffer-file-name))))
nil)
(defun whitespace-unload-function ()
"Unload the whitespace library."
(whitespace-global-mode -1)
(save-current-buffer
(dolist (buf (buffer-list))
(set-buffer buf)
(remove-hook 'write-file-functions 'whitespace-write-file-hook t)))
;; new-style unloading, stop old style from running
(with-no-warnings (setq whitespace-unload-hook nil))
;; continue standard unloading
nil)
(defun whitespace-unload-hook ()
(remove-hook 'find-file-hook 'whitespace-buffer)
(remove-hook 'write-file-functions 'whitespace-write-file-hook t)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment