summaryrefslogtreecommitdiff
path: root/lisp/whitespace.el
diff options
context:
space:
mode:
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))