Commit 143c797d authored by Vinicius Jose Latorre's avatar Vinicius Jose Latorre
Browse files

Don't clean up a buffer when killing it.

parent bc27c677
......@@ -40,6 +40,11 @@
in a highlighted region: indent each line in region according to
mode. Supply this so it works in XEmacs and older Emacs.
2008-09-05 Vinicius Jose Latorre <viniciusjl@ig.com.br>
* whitespace.el (whitespace-kill-buffer-hook, whitespace-action): Don't
clean up a buffer when killing it.
2008-09-05 Vinicius Jose Latorre <viniciusjl@ig.com.br>
* whitespace.el: Fix auto-cleanup on kill prevents killing read-only
......
......@@ -2403,15 +2403,16 @@ It should be added buffer-locally to `write-file-functions'."
(defun whitespace-kill-buffer-hook ()
"Action to be taken when buffer is killed.
It should be added buffer-locally to `kill-buffer-hook'."
(whitespace-action)
(whitespace-action t)
nil) ; continue hook processing
(defun whitespace-action ()
(defun whitespace-action (&optional is-killing-buffer)
"Action to be taken when buffer is killed or written.
Return t when the action should be aborted."
(cond ((memq 'auto-cleanup whitespace-action)
(whitespace-cleanup)
(unless is-killing-buffer
(whitespace-cleanup))
nil)
((memq 'abort-on-bogus whitespace-action)
(whitespace-report nil 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