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 <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
(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))