Mercurial > emacs
annotate lisp/whitespace.el @ 25643:385bf7dbf253
(run_window_scroll_functions): If hook functions switch
buffers, switch back after.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 12 Sep 1999 02:49:25 +0000 |
parents | c0e27d3ce645 |
children | 6664d8f25ea5 |
rev | line source |
---|---|
25582 | 1 ;;; whitespace.el --- Warn about and clean bogus whitespaces in the file. |
2 | |
3 ;; Copyright (C) 1999 Free Software Foundation, Inc. | |
4 | |
5 ;; Author: Rajesh Vaidheeswarran <rv@dsmit.com> | |
6 ;; Keywords: convenience | |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 ;; Boston, MA 02111-1307, USA. | |
24 | |
25 ;;; Commentary: | |
26 | |
27 ;; Whitespace.el URL: http://www.dsmit.com/lisp/ | |
28 | |
29 ;; Exported functions: | |
30 | |
31 ;; `whitespace-buffer' - To check the current buffer for whitespace problems. | |
32 ;; `whitespace-cleanup' - To cleanup all whitespaces in the current buffer. | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
33 ;; `whitespace-region' - To check between point and mark for whitespace |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
34 ;; problems. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
35 ;; `whitespace-cleanup-region' - To cleanup all whitespaces between point |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
36 ;; and mark in the current buffer. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
37 ;; `whitespace-describe' - A simple introduction to the library. |
25582 | 38 |
39 ;;; Code: | |
40 | |
41 ;; add a hook to find-file-hooks and kill-buffer-hook | |
42 (add-hook 'find-file-hooks 'whitespace-buffer) | |
43 (add-hook 'kill-buffer-hook 'whitespace-buffer) | |
44 | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
45 (defvar whitespace-version "2.3" "Version of the whitespace library.") |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
46 ;; Find out what type of Emacs we are running in. |
25582 | 47 (defvar whitespace-running-emacs (if (string-match "XEmacs\\|Lucid" |
48 emacs-version) nil t) | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
49 "If this is Emacs, not XEmacs, this is t.") |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
50 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
51 (if whitespace-running-emacs (require 'timer)) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
52 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
53 (defvar whitespace-all-buffer-files nil |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
54 "An associated list of buffers and files checked for whitespace cleanliness. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
55 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
56 This is to enable periodic checking of whitespace cleanliness in the files |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
57 visited by the buffers.") |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
58 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
59 (defvar whitespace-rescan-timer nil |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
60 "Timer object used to rescan the files in buffers that have been modified.") |
25582 | 61 |
62 ;; For users of Emacs 19.x, defgroup and defcustom are not defined. | |
63 | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
64 (eval-when-compile |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
65 (if (< (string-to-int emacs-version) 20) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
66 (progn |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
67 (defmacro defgroup (sym memb doc &rest args) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
68 "Null macro for defgroup in all versions of Emacs < 20.x" |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
69 t) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
70 (defmacro defcustom (sym val doc &rest args) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
71 "Macro to alias defcustom to defvar in all versions of Emacs < 20.x" |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
72 `(defvar ,sym ,val ,doc))))) |
25582 | 73 |
74 (defgroup whitespace nil | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
75 "Check for and fix five different types of whitespaces in source code." |
25582 | 76 ;; Since XEmacs doesn't have a 'convenience group, use the next best group |
77 ;; which is 'editing? | |
78 :group (if whitespace-running-emacs 'convenience 'editing)) | |
79 | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
80 (defcustom whitespace-spacetab-regexp " \t" |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
81 "Regexp to match a TAB followed by a space." |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
82 :type 'string |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
83 :group 'whitespace) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
84 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
85 (defcustom whitespace-indent-regexp (concat "^\\(\t*\\) " " ") |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
86 "Regexp to match (any TABS followed by) 8/more whitespaces at start of line." |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
87 :type 'string |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
88 :group 'whitespace) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
89 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
90 (defcustom whitespace-ateol-regexp "[ \t]$" |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
91 "Regexp to match a TAB or a space at the EOL." |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
92 :type 'string |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
93 :group 'whitespace) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
94 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
95 (defcustom whitespace-errbuf "*Whitespace Errors*" |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
96 "The buffer where whitespace related messages will be logged." |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
97 :type 'string |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
98 :group 'whitespace) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
99 |
25582 | 100 (defcustom whitespace-auto-cleanup nil |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
101 "Cleanup a buffer automatically on finding it whitespace unclean." |
25582 | 102 :type 'boolean |
103 :group 'whitespace) | |
104 | |
105 (defcustom whitespace-silent nil | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
106 "All whitespace errors will be shown only in the modeline when t. |
25582 | 107 |
108 Note that setting this may cause all whitespaces introduced in a file to go | |
109 unnoticed when the buffer is killed, unless the user visits the `*Whitespace | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
110 Errors*' buffer before opening (or closing) another file." |
25582 | 111 :type 'boolean |
112 :group 'whitespace) | |
113 | |
114 (defcustom whitespace-modes '(ada-mode asm-mode autoconf-mode awk-mode | |
115 c-mode c++-mode cc-mode cperl-mode | |
116 electric-nroff-mode emacs-lisp-mode | |
117 f90-mode fortran-mode html-mode | |
118 html3-mode java-mode jde-mode | |
119 ksh-mode latex-mode LaTeX-mode | |
120 lisp-mode m4-mode makefile-mode | |
121 modula-2-mode nroff-mode objc-mode | |
122 pascal-mode perl-mode prolog-mode | |
123 python-mode scheme-mode sgml-mode | |
124 sh-mode shell-script-mode | |
125 simula-mode tcl-mode tex-mode | |
126 texinfo-mode vrml-mode xml-mode) | |
127 | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
128 "Major Modes in which we turn on whitespace checking. |
25582 | 129 |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
130 These are mostly programming and documentation modes. But you may add other |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
131 modes that you want whitespaces checked in by adding something like the |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
132 following to your `.emacs': |
25582 | 133 |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
134 \(setq whitespace-modes (cons 'my-mode (cons 'my-other-mode |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
135 whitespace-modes))\) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
136 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
137 Or, alternately, you can use the Emacs `customize' command to set this." |
25582 | 138 :group 'whitespace) |
139 | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
140 (defcustom whitespace-rescan-timer-time 60 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
141 "Period in seconds to rescan modified buffers for whitespace creep. |
25582 | 142 |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
143 This is the period after which the timer will fire causing |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
144 `whitespace-rescan-files-in-buffers' to check for whitespace creep in |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
145 modified buffers." |
25582 | 146 :type 'integer |
147 :group 'whitespace) | |
148 | |
149 ;; Tell Emacs about this new kind of minor mode | |
150 (make-variable-buffer-local 'whitespace-mode) | |
151 (put 'whitespace-mode 'permanent-local nil) | |
152 (set-default 'whitespace-mode nil) | |
153 | |
154 (make-variable-buffer-local 'whitespace-mode-line) | |
155 (put 'whitespace-mode-line 'permanent-local nil) | |
156 (set-default 'whitespace-mode-line nil) | |
157 | |
158 (if (not (assoc 'whitespace-mode minor-mode-alist)) | |
159 (setq minor-mode-alist (cons '(whitespace-mode whitespace-mode-line) | |
160 minor-mode-alist))) | |
161 | |
162 (defun whitespace-check-whitespace-mode (&optional arg) | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
163 "Test and set the whitespace-mode in qualifying buffers." |
25582 | 164 (if (null whitespace-mode) |
165 (setq whitespace-mode | |
166 (if (or arg (member major-mode whitespace-modes)) | |
167 t | |
168 nil)))) | |
169 | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
170 ;;;###autoload |
25582 | 171 (defun whitespace-buffer (&optional quiet) |
172 "Find five different types of white spaces in buffer: | |
173 | |
174 1. Leading space \(empty lines at the top of a file\). | |
175 2. Trailing space \(empty lines at the end of a file\). | |
176 3. Indentation space \(8 or more spaces, that should be replaced with TABS\). | |
177 4. Spaces followed by a TAB. \(Almost always, we never want that\). | |
178 5. Spaces or TABS at the end of a line. | |
179 | |
180 Check for whitespace only if this buffer really contains a non-empty file | |
181 and: | |
182 1. the major mode is one of the whitespace-modes, or | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
183 2. `whitespace-buffer' was explicitly called with a prefix argument." |
25582 | 184 (interactive) |
185 (whitespace-check-whitespace-mode current-prefix-arg) | |
186 (if (and buffer-file-name (> (buffer-size) 0) whitespace-mode) | |
187 (progn | |
188 (whitespace-check-buffer-list (buffer-name) buffer-file-name) | |
189 (whitespace-tickle-timer) | |
190 (if whitespace-auto-cleanup | |
191 (if (and (not quiet) buffer-read-only) | |
192 (message "Can't Cleanup: %s is read-only." (buffer-name)) | |
193 (whitespace-cleanup)) | |
194 (let ((whitespace-leading (whitespace-buffer-leading)) | |
195 (whitespace-trailing (whitespace-buffer-trailing)) | |
196 (whitespace-indent (whitespace-buffer-search | |
197 whitespace-indent-regexp)) | |
198 (whitespace-spacetab (whitespace-buffer-search | |
199 whitespace-spacetab-regexp)) | |
200 (whitespace-ateol (whitespace-buffer-search | |
201 whitespace-ateol-regexp)) | |
202 (whitespace-errmsg nil) | |
203 (whitespace-error nil) | |
204 (whitespace-filename buffer-file-name) | |
205 (whitespace-this-modeline "")) | |
206 | |
207 ;; Now let's complain if we found any of the above. | |
208 (setq whitespace-error (or whitespace-leading whitespace-indent | |
209 whitespace-spacetab whitespace-ateol | |
210 whitespace-trailing)) | |
211 | |
212 (if whitespace-error | |
213 (progn | |
214 (setq whitespace-errmsg | |
215 (concat whitespace-filename " contains:\n" | |
216 (if whitespace-leading "Leading whitespace\n") | |
217 (if whitespace-indent | |
218 (concat "Indentation whitespace" | |
219 whitespace-indent "\n")) | |
220 (if whitespace-spacetab | |
221 (concat "Space followed by Tab" | |
222 whitespace-spacetab "\n")) | |
223 (if whitespace-ateol | |
224 (concat "End-of-line whitespace" | |
225 whitespace-ateol "\n")) | |
226 (if whitespace-trailing | |
227 "Trailing whitespace.\n") | |
228 "\ntype " | |
229 "`whitespace-cleanup' to cleanup the file.")) | |
230 (setq whitespace-this-modeline | |
231 (concat (if whitespace-ateol "e") | |
232 (if whitespace-indent "i") | |
233 (if whitespace-leading "l") | |
234 (if whitespace-spacetab "s") | |
235 (if whitespace-trailing "t"))) | |
236 (setq whitespace-mode-line | |
237 (concat " W:" whitespace-this-modeline)) | |
238 (whitespace-force-mode-line-update))) | |
239 (save-excursion | |
240 (get-buffer-create whitespace-errbuf) | |
241 (kill-buffer whitespace-errbuf) | |
242 (get-buffer-create whitespace-errbuf) | |
243 (set-buffer whitespace-errbuf) | |
244 (if whitespace-errmsg | |
245 (progn | |
246 (insert whitespace-errmsg) | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
247 (if (not (or quiet whitespace-silent)) |
25582 | 248 (display-buffer whitespace-errbuf t)) |
249 (if (not quiet) | |
250 (message "Whitespaces: [%s] in %s" | |
251 whitespace-this-modeline | |
252 whitespace-filename))) | |
253 (if (not quiet) | |
254 (message "%s clean" whitespace-filename))))))))) | |
255 | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
256 ;;;###autoload |
25582 | 257 (defun whitespace-region (s e) |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
258 "Check a region specified by point and mark for whitespace errors." |
25582 | 259 (interactive "r") |
260 (save-excursion | |
261 (save-restriction | |
262 (narrow-to-region s e) | |
263 (whitespace-buffer)))) | |
264 | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
265 ;;;###autoload |
25582 | 266 (defun whitespace-cleanup () |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
267 "Cleanup the five different kinds of whitespace problems. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
268 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
269 Use \\[describe-function] whitespace-describe to read a summary of the |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
270 whitespace problems." |
25582 | 271 (interactive) |
272 ;; If this buffer really contains a file, then run, else quit. | |
273 (whitespace-check-whitespace-mode current-prefix-arg) | |
274 (if (and buffer-file-name whitespace-mode) | |
275 (let ((whitespace-any nil) | |
276 (whitespace-tabwith 8) | |
277 (whitespace-tabwith-saved tab-width)) | |
278 | |
279 ;; since all printable TABS should be 8, irrespective of how | |
280 ;; they are displayed. | |
281 (setq tab-width whitespace-tabwith) | |
282 | |
283 (if (whitespace-buffer-leading) | |
284 (progn | |
285 (whitespace-buffer-leading-cleanup) | |
286 (setq whitespace-any t))) | |
287 | |
288 (if (whitespace-buffer-trailing) | |
289 (progn | |
290 (whitespace-buffer-trailing-cleanup) | |
291 (setq whitespace-any t))) | |
292 | |
293 (if (whitespace-buffer-search whitespace-indent-regexp) | |
294 (progn | |
295 (whitespace-indent-cleanup) | |
296 (setq whitespace-any t))) | |
297 | |
298 (if (whitespace-buffer-search whitespace-spacetab-regexp) | |
299 (progn | |
300 (whitespace-buffer-cleanup whitespace-spacetab-regexp "\t") | |
301 (setq whitespace-any t))) | |
302 | |
303 (if (whitespace-buffer-search whitespace-ateol-regexp) | |
304 (progn | |
305 (whitespace-buffer-cleanup whitespace-ateol-regexp "") | |
306 (setq whitespace-any t))) | |
307 | |
308 ;; Call this recursively till everything is taken care of | |
309 (if whitespace-any (whitespace-cleanup) | |
310 (progn | |
311 (message "%s clean" buffer-file-name) | |
312 (setq whitespace-mode-line nil) | |
313 (whitespace-force-mode-line-update))) | |
314 (setq tab-width whitespace-tabwith-saved)))) | |
315 | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
316 ;;;###autoload |
25582 | 317 (defun whitespace-cleanup-region (s e) |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
318 "Whitespace cleanup on a region specified by point and mark." |
25582 | 319 (interactive "r") |
320 (save-excursion | |
321 (save-restriction | |
322 (narrow-to-region s e) | |
323 (whitespace-cleanup)) | |
324 (whitespace-buffer t))) | |
325 | |
326 (defun whitespace-buffer-leading () | |
327 "Check to see if there are any empty lines at the top of the file." | |
328 (save-excursion | |
329 (let ((pmin nil) | |
330 (pmax nil)) | |
331 (goto-char (point-min)) | |
332 (beginning-of-line) | |
333 (setq pmin (point)) | |
334 (end-of-line) | |
335 (setq pmax (point)) | |
336 (if (equal pmin pmax) | |
337 t | |
338 nil)))) | |
339 | |
340 (defun whitespace-buffer-leading-cleanup () | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
341 "Remove any empty lines at the top of the file." |
25582 | 342 (save-excursion |
343 (let ((pmin nil) | |
344 (pmax nil)) | |
345 (goto-char (point-min)) | |
346 (beginning-of-line) | |
347 (setq pmin (point)) | |
348 (end-of-line) | |
349 (setq pmax (point)) | |
350 (if (equal pmin pmax) | |
351 (progn | |
352 (kill-line) | |
353 (whitespace-buffer-leading-cleanup)))))) | |
354 | |
355 (defun whitespace-buffer-trailing () | |
356 "Check to see if are is more than one empty line at the bottom." | |
357 (save-excursion | |
358 (let ((pmin nil) | |
359 (pmax nil)) | |
360 (goto-char (point-max)) | |
361 (beginning-of-line) | |
362 (setq pmin (point)) | |
363 (end-of-line) | |
364 (setq pmax (point)) | |
365 (if (equal pmin pmax) | |
366 (progn | |
367 (goto-char (- (point) 1)) | |
368 (beginning-of-line) | |
369 (setq pmin (point)) | |
370 (end-of-line) | |
371 (setq pmax (point)) | |
372 (if (equal pmin pmax) | |
373 t | |
374 nil)) | |
375 nil)))) | |
376 | |
377 (defun whitespace-buffer-trailing-cleanup () | |
378 "Delete all the empty lines at the bottom." | |
379 (save-excursion | |
380 (let ((pmin nil) | |
381 (pmax nil)) | |
382 (goto-char (point-max)) | |
383 (beginning-of-line) | |
384 (setq pmin (point)) | |
385 (end-of-line) | |
386 (setq pmax (point)) | |
387 (if (equal pmin pmax) | |
388 (progn | |
389 (goto-char (1- pmin)) | |
390 (beginning-of-line) | |
391 (setq pmin (point)) | |
392 (end-of-line) | |
393 (setq pmax (point)) | |
394 (if (equal pmin pmax) | |
395 (progn | |
396 (goto-char (1- (point-max))) | |
397 (beginning-of-line) | |
398 (kill-line) | |
399 (whitespace-buffer-trailing-cleanup)))))))) | |
400 | |
401 (defun whitespace-buffer-search (regexp) | |
402 "Search for any given whitespace REGEXP." | |
403 (let ((whitespace-retval "")) | |
404 (save-excursion | |
405 (goto-char (point-min)) | |
406 (while (re-search-forward regexp nil t) | |
407 (setq whitespace-retval (format "%s %s " whitespace-retval | |
408 (match-beginning 0)))) | |
409 (if (equal "" whitespace-retval) | |
410 nil | |
411 whitespace-retval)))) | |
412 | |
413 (defun whitespace-buffer-cleanup (regexp newregexp) | |
414 "Search for any given whitespace REGEXP and replace it with the NEWREGEXP." | |
415 (save-excursion | |
416 (goto-char (point-min)) | |
417 (while (re-search-forward regexp nil t) | |
418 (replace-match newregexp)))) | |
419 | |
420 (defun whitespace-indent-cleanup () | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
421 "Search for 8/more spaces at the start of a line and replace it with tabs." |
25582 | 422 (save-excursion |
423 (goto-char (point-min)) | |
424 (while (re-search-forward whitespace-indent-regexp nil t) | |
425 (let ((column (current-column)) | |
426 (indent-tabs-mode t)) | |
427 (delete-region (match-beginning 0) (point)) | |
428 (indent-to column))))) | |
429 | |
430 ;; Force mode line updation for different Emacs versions | |
431 (defun whitespace-force-mode-line-update () | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
432 "Force the mode line update for different flavors of Emacs." |
25582 | 433 (if whitespace-running-emacs |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
434 (force-mode-line-update) ; Emacs |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
435 (redraw-modeline))) ; XEmacs |
25582 | 436 |
437 (defun whitespace-check-buffer-list (buf-name buf-file) | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
438 "Add a buffer and its file to the whitespace monitor list. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
439 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
440 The buffer named BUF-NAME and its associated file BUF-FILE are now monitored |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
441 periodically for whitespace." |
25582 | 442 (if (and whitespace-mode (not (member (list buf-file buf-name) |
443 whitespace-all-buffer-files))) | |
444 (add-to-list 'whitespace-all-buffer-files (list buf-file buf-name)))) | |
445 | |
446 (defun whitespace-tickle-timer () | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
447 "Tickle timer to periodically to scan qualifying files for whitespace creep. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
448 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
449 If timer is not set, then set it to scan the files in |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
450 `whitespace-all-buffer-files' periodically (defined by |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
451 `whitespace-rescan-timer-time') for whitespace creep." |
25582 | 452 (if (not whitespace-rescan-timer) |
453 (setq whitespace-rescan-timer | |
454 (if whitespace-running-emacs | |
455 (run-at-time nil whitespace-rescan-timer-time | |
456 'whitespace-rescan-files-in-buffers) | |
457 (add-timeout whitespace-rescan-timer-time | |
458 'whitespace-rescan-files-in-buffers nil | |
459 whitespace-rescan-timer-time))))) | |
460 | |
461 (defun whitespace-rescan-files-in-buffers (&optional arg) | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
462 "Check monitored files for whitespace creep since last scan." |
25582 | 463 (let ((whitespace-all-my-files whitespace-all-buffer-files) |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
464 buffile bufname thiselt buf) |
25582 | 465 (if (not whitespace-all-my-files) |
466 (progn | |
467 (if whitespace-running-emacs | |
468 (cancel-timer whitespace-rescan-timer) | |
469 (disable-timeout whitespace-rescan-timer)) | |
470 (setq whitespace-rescan-timer nil)) | |
471 (while whitespace-all-my-files | |
472 (setq thiselt (car whitespace-all-my-files)) | |
473 (setq whitespace-all-my-files (cdr whitespace-all-my-files)) | |
474 (setq buffile (car thiselt)) | |
475 (setq bufname (cadr thiselt)) | |
476 (setq buf (get-buffer bufname)) | |
477 (if (buffer-live-p buf) | |
478 (save-excursion | |
479 ;;(message "buffer %s live" bufname) | |
480 (set-buffer bufname) | |
481 (if whitespace-mode | |
482 (progn | |
483 ;;(message "checking for whitespace in %s" bufname) | |
484 (if whitespace-auto-cleanup | |
485 (progn | |
486 ;;(message "cleaning up whitespace in %s" bufname) | |
487 (whitespace-cleanup)) | |
488 (progn | |
489 ;;(message "whitespace-buffer %s." (buffer-name)) | |
490 (whitespace-buffer t)))) | |
491 ;;(message "Removing %s from refresh list" bufname) | |
492 (whitespace-refresh-rescan-list buffile bufname))) | |
493 ;;(message "Removing %s from refresh list" bufname) | |
494 (whitespace-refresh-rescan-list buffile bufname)))))) | |
495 | |
496 (defun whitespace-refresh-rescan-list (buffile bufname) | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
497 "Refresh the list of files to be rescaned for whitespace creep." |
25582 | 498 (if whitespace-all-buffer-files |
499 (progn | |
500 (setq whitespace-all-buffer-files | |
501 (delete (list buffile bufname) whitespace-all-buffer-files))) | |
502 (progn | |
503 (if (and whitespace-running-emacs (timerp whitespace-rescan-timer)) | |
504 (cancel-timer whitespace-rescan-timer)) | |
505 (if (and (not whitespace-running-emacs) whitespace-rescan-timer) | |
506 (disable-timeout whitespace-rescan-timer)) | |
507 (if whitespace-rescan-timer | |
508 (setq whitespace-rescan-timer nil))))) | |
509 | |
25625
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
510 ;;;###autoload |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
511 (defun whitespace-describe () |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
512 "A summary of whitespaces and what this library can do about them. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
513 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
514 The whitespace library is intended to find and help fix five different types |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
515 of whitespace problems that commonly exist in source code. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
516 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
517 1. Leading space (empty lines at the top of a file). |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
518 2. Trailing space (empty lines at the end of a file). |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
519 3. Indentation space (8 or more spaces at beginning of line, that should be |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
520 replaced with TABS). |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
521 4. Spaces followed by a TAB. (Almost always, we never want that). |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
522 5. Spaces or TABS at the end of a line. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
523 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
524 Whitespace errors are reported in a buffer, and on the modeline. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
525 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
526 Modeline will show a W:<x> to denote a particular type of whitespace, where |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
527 `x' can be one (or more) of: |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
528 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
529 e - End-of-Line whitespace. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
530 i - Indentation whitespace. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
531 l - Leading whitespace. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
532 s - Space followed by Tab. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
533 t - Trailing whitespace. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
534 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
535 (since (3) is the most controversial one, here is the rationale: Most |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
536 terminal drivers and printer drivers have TAB configured or even |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
537 hardcoded to be 8 spaces. (Some of them allow configuration, but almost |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
538 always they default to 8.) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
539 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
540 Changing tab-width to other than 8 and editing will cause your code to |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
541 look different from within Emacs, and say, if you cat it or more it, or |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
542 even print it. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
543 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
544 Almost all the popular programming modes let you define an offset (like |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
545 c-basic-offset or perl-indent-level) to configure the offset, so you |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
546 should never have to set your tab-width to be other than 8 in all these |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
547 modes. In fact, with an indent level of say, 4, 2 TABS will cause Emacs |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
548 to replace your 8 spaces with one \t (try it). If vi users in your |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
549 office complain, tell them to use vim, which distinguishes between |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
550 tabstop and shiftwidth (vi equivalent of our offsets), and also ask them |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
551 to set smarttab.) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
552 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
553 All the above have caused (and will cause) unwanted codeline integration and |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
554 merge problems. |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
555 |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
556 whitespace.el will complain if it detects whitespaces on opening a file, and |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
557 warn you on closing a file also. (if in case you had inserted any |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
558 whitespaces during the process of your editing.)" |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
559 (interactive) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
560 (message "Use C-h f whitespace-describe to read about whitespace.el v%s." |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
561 whitespace-version)) |
c0e27d3ce645
Finish making it fit Emacs conventions. Add autoloads.
Richard M. Stallman <rms@gnu.org>
parents:
25582
diff
changeset
|
562 |
25582 | 563 (provide 'whitespace) |
564 | |
565 ;;; whitespace.el ends here |