Don't clean up a buffer when killing it.

This commit is contained in:
Vinicius Jose Latorre 2008-09-06 01:36:27 +00:00
parent bc27c677ac
commit 143c797dc8
2 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -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))