From: Vinicius Jose Latorre Date: Sat, 6 Sep 2008 01:36:27 +0000 (+0000) Subject: Don't clean up a buffer when killing it. X-Git-Tag: emacs-pretest-23.0.90~3024 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=143c797dc861f522b220ebb59466bb482f9107c5;p=emacs.git Don't clean up a buffer when killing it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3e75e2a720a..2bdab884b93 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 + + * whitespace.el (whitespace-kill-buffer-hook, whitespace-action): Don't + clean up a buffer when killing it. + 2008-09-05 Vinicius Jose Latorre * whitespace.el: Fix auto-cleanup on kill prevents killing read-only diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 59da0469be3..56d4e58f138 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -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))