changeset 98009:acd38bba28b7

Don't clean up a buffer when killing it.
author Vinicius Jose Latorre <viniciusjl@ig.com.br>
date Sat, 06 Sep 2008 01:36:27 +0000
parents 4ec5decd0683
children 349b0016c863
files lisp/ChangeLog lisp/whitespace.el
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Sep 06 00:19:31 2008 +0000
+++ b/lisp/ChangeLog	Sat Sep 06 01:36:27 2008 +0000
@@ -42,6 +42,11 @@
 
 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
 	buffers (bug#360). New version 11.2.1.
 	(whitespace-action): New value `warn-read-only' to give a warning when
--- a/lisp/whitespace.el	Sat Sep 06 00:19:31 2008 +0000
+++ b/lisp/whitespace.el	Sat Sep 06 01:36:27 2008 +0000
@@ -2403,15 +2403,16 @@
 (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))