summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorVinicius Jose Latorre <viniciusjl@ig.com.br>2008-09-06 01:36:27 +0000
committerVinicius Jose Latorre <viniciusjl@ig.com.br>2008-09-06 01:36:27 +0000
commit143c797dc861f522b220ebb59466bb482f9107c5 (patch)
tree5129e2bbd314f0bf607decca25beb55a85f7272c /lisp
parentbc27c677acf048b3d40a3ac2b2e6bf8907c24a4d (diff)
Don't clean up a buffer when killing it.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/whitespace.el7
2 files changed, 9 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3e75e2a720a..2bdab884b93 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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
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))