33 |
;; 1. Leading space (empty lines at the top of a file). |
;; 1. Leading space (empty lines at the top of a file). |
34 |
;; 2. Trailing space (empty lines at the end of a file). |
;; 2. Trailing space (empty lines at the end of a file). |
35 |
;; 3. Indentation space (8 or more spaces at beginning of line, that should be |
;; 3. Indentation space (8 or more spaces at beginning of line, that should be |
36 |
;; replaced with TABS). |
;; replaced with TABS). |
37 |
;; 4. Spaces followed by a TAB. (Almost always, we never want that). |
;; 4. Spaces followed by a TAB. (Almost always, we never want that). |
38 |
;; 5. Spaces or TABS at the end of a line. |
;; 5. Spaces or TABS at the end of a line. |
39 |
;; |
;; |
87 |
|
|
88 |
;;; Code: |
;;; Code: |
89 |
|
|
90 |
(defvar whitespace-version "3.3" "Version of the whitespace library.") |
(defvar whitespace-version "3.4" "Version of the whitespace library.") |
91 |
|
|
92 |
(defvar whitespace-all-buffer-files nil |
(defvar whitespace-all-buffer-files nil |
93 |
"An associated list of buffers and files checked for whitespace cleanliness. |
"An associated list of buffers and files checked for whitespace cleanliness. |
236 |
:type 'string |
:type 'string |
237 |
:group 'whitespace) |
:group 'whitespace) |
238 |
|
|
239 |
|
(defcustom whitespace-clean-msg "clean." |
240 |
|
"If non-nil, this message will be displayed after a whitespace check |
241 |
|
determines a file to be clean." |
242 |
|
:type 'string |
243 |
|
:group 'whitespace) |
244 |
|
|
245 |
(defcustom whitespace-abort-on-error nil |
(defcustom whitespace-abort-on-error nil |
246 |
"While writing a file, abort if the file is unclean. If |
"While writing a file, abort if the file is unclean. If |
247 |
`whitespace-auto-cleanup' is set, that takes precedence over this |
`whitespace-auto-cleanup' is set, that takes precedence over this |
509 |
(concat "!" whitespace-unchecked) |
(concat "!" whitespace-unchecked) |
510 |
"")) |
"")) |
511 |
whitespace-filename))) |
whitespace-filename))) |
512 |
(if (not quiet) |
(if (and (not quiet) (not (equal whitespace-clean-msg ""))) |
513 |
(message "%s clean" whitespace-filename)))))))) |
(message "%s %s" whitespace-filename |
514 |
|
whitespace-clean-msg)))))))) |
515 |
(if whitespace-error |
(if whitespace-error |
516 |
t |
t |
517 |
nil))) |
nil))) |
823 |
;;;###autoload |
;;;###autoload |
824 |
(define-minor-mode whitespace-global-mode |
(define-minor-mode whitespace-global-mode |
825 |
"Toggle using Whitespace mode in new buffers. |
"Toggle using Whitespace mode in new buffers. |
826 |
With ARG, turn the mode on if and only iff ARG is positive. |
With ARG, turn the mode on iff ARG is positive. |
827 |
|
|
828 |
When this mode is active, `whitespace-buffer' is added to |
When this mode is active, `whitespace-buffer' is added to |
829 |
`find-file-hook' and `kill-buffer-hook'." |
`find-file-hook' and `kill-buffer-hook'." |