summaryrefslogtreecommitdiff
path: root/lisp/whitespace.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2006-08-18 12:50:08 +0000
committerEli Zaretskii <eliz@gnu.org>2006-08-18 12:50:08 +0000
commit6e6f0cb6ab4c8df5f33d5d857147f15a52400bf2 (patch)
tree28a75a4dd8fb02bc23105147da2d8c19ac223615 /lisp/whitespace.el
parentb8ae17637ce688e240446e680ee930002fd8beec (diff)
(whitespace-cleanup-internal): New optional arg REGION-ONLY. If it's non-nil,
modify the message to the user accordingly. (whitespace-cleanup-region): Call whitespace-cleanup-internal with a non-nil argument.
Diffstat (limited to 'lisp/whitespace.el')
-rw-r--r--lisp/whitespace.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 449606607f6..1d162e515e4 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -524,7 +524,7 @@ See `whitespace-buffer' docstring for a summary of the problems."
(whitespace-cleanup-region (region-beginning) (region-end))
(whitespace-cleanup-internal)))
-(defun whitespace-cleanup-internal ()
+(defun whitespace-cleanup-internal (&optional region-only)
;; If this buffer really contains a file, then run, else quit.
(whitespace-check-whitespace-mode current-prefix-arg)
(if (and buffer-file-name whitespace-mode)
@@ -569,9 +569,12 @@ See `whitespace-buffer' docstring for a summary of the problems."
;; Call this recursively till everything is taken care of
(if whitespace-any
(whitespace-cleanup-internal)
+ ;; if we are done, talk to the user
(progn
- (if (not whitespace-silent)
- (message "%s clean" buffer-file-name))
+ (unless whitespace-silent
+ (if region-only
+ (message "The region is now clean")
+ (message "%s is now clean" buffer-file-name)))
(whitespace-update-modeline)))
(setq tab-width whitespace-tabwith-saved))))
@@ -582,7 +585,7 @@ See `whitespace-buffer' docstring for a summary of the problems."
(save-excursion
(save-restriction
(narrow-to-region s e)
- (whitespace-cleanup-internal))
+ (whitespace-cleanup-internal t))
(whitespace-buffer t)))
(defun whitespace-buffer-leading ()