summaryrefslogtreecommitdiff
path: root/lisp/whitespace.el
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/whitespace.el
parentbc27c677acf048b3d40a3ac2b2e6bf8907c24a4d (diff)
downloademacs-143c797dc861f522b220ebb59466bb482f9107c5.tar.gz
Don't clean up a buffer when killing it.
Diffstat (limited to 'lisp/whitespace.el')
-rw-r--r--lisp/whitespace.el7
1 files changed, 4 insertions, 3 deletions
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))