]> code.delx.au - gnu-emacs/blobdiff - lisp/whitespace.el
Add a provide statement.
[gnu-emacs] / lisp / whitespace.el
index 7750c194f9a676db51efef7a371473006df0fdea..323c75ed6defd1a08f10a22cea220a40d1c22d0a 100644 (file)
@@ -5,7 +5,6 @@
 ;; Author: Rajesh Vaidheeswarran <rv@gnu.org>
 ;; Keywords: convenience
 
-;; $Id: whitespace.el,v 1.23 2003/05/13 14:30:58 rv Exp $
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
@@ -33,7 +32,7 @@
 ;; 1. Leading space (empty lines at the top of a file).
 ;; 2. Trailing space (empty lines at the end of a file).
 ;; 3. Indentation space (8 or more spaces at beginning of line, that should be
-;;                   replaced with TABS).
+;;                   replaced with TABS).
 ;; 4. Spaces followed by a TAB.  (Almost always, we never want that).
 ;; 5. Spaces or TABS at the end of a line.
 ;;
@@ -87,7 +86,7 @@
 
 ;;; Code:
 
-(defvar whitespace-version "3.3" "Version of the whitespace library.")
+(defvar whitespace-version "3.4" "Version of the whitespace library.")
 
 (defvar whitespace-all-buffer-files nil
   "An associated list of buffers and files checked for whitespace cleanliness.
@@ -236,6 +235,12 @@ It can be overriden by setting a buffer local variable
   :type 'string
   :group 'whitespace)
 
+(defcustom whitespace-clean-msg "clean."
+  "If non-nil, this message will be displayed after a whitespace check
+determines a file to be clean."
+  :type 'string
+  :group 'whitespace)
+
 (defcustom whitespace-abort-on-error nil
   "While writing a file, abort if the file is unclean. If
 `whitespace-auto-cleanup' is set, that takes precedence over this
@@ -503,8 +508,9 @@ and:
                                         (concat "!" whitespace-unchecked)
                                       ""))
                                   whitespace-filename)))
-                 (if (not quiet)
-                     (message "%s clean" whitespace-filename))))))))
+                 (if (and (not quiet) (not (equal whitespace-clean-msg "")))
+                     (message "%s %s" whitespace-filename
+                              whitespace-clean-msg))))))))
     (if whitespace-error
        t
       nil)))
@@ -570,7 +576,8 @@ whitespace problems."
        (if whitespace-any
            (whitespace-cleanup)
          (progn
-           (message "%s clean" buffer-file-name)
+           (if (not whitespace-silent)
+               (message "%s clean" buffer-file-name))
            (whitespace-update-modeline)))
        (setq tab-width whitespace-tabwith-saved))))
 
@@ -812,10 +819,13 @@ If timer is not set, then set it to scan the files in
       (disable-timeout whitespace-rescan-timer)
       (setq whitespace-rescan-timer nil))))
 
+;;;###autoload
+(defalias 'global-whitespace-mode 'whitespace-global-mode)
+
 ;;;###autoload
 (define-minor-mode whitespace-global-mode
   "Toggle using Whitespace mode in new buffers.
-With ARG, turn the mode on if and only iff ARG is positive.
+With ARG, turn the mode on iff ARG is positive.
 
 When this mode is active, `whitespace-buffer' is added to
 `find-file-hook' and `kill-buffer-hook'."
@@ -849,5 +859,9 @@ This is meant to be added buffer-locally to `write-file-functions'."
   (remove-hook 'write-file-functions 'whitespace-write-file-hook t)
   (remove-hook 'kill-buffer-hook 'whitespace-buffer))
 
+(add-hook 'whitespace-unload-hook 'whitespace-unload-hook)
+
 (provide 'whitespace)
+
+;;; arch-tag: 4ff44e87-b63c-402d-95a6-15e51e58bd0c
 ;;; whitespace.el ends here