109 |
(put 'whitespace-mode-line 'permanent-local nil) |
(put 'whitespace-mode-line 'permanent-local nil) |
110 |
|
|
111 |
(defvar whitespace-check-buffer-leading nil |
(defvar whitespace-check-buffer-leading nil |
112 |
"Test leading whitespace for file in current buffer if t") |
"Test leading whitespace for file in current buffer if t.") |
113 |
(make-variable-buffer-local 'whitespace-check-buffer-leading) |
(make-variable-buffer-local 'whitespace-check-buffer-leading) |
114 |
(put 'whitespace-check-buffer-leading 'permanent-local nil) |
(put 'whitespace-check-buffer-leading 'permanent-local nil) |
115 |
|
|
116 |
(defvar whitespace-check-buffer-trailing nil |
(defvar whitespace-check-buffer-trailing nil |
117 |
"Test trailing whitespace for file in current buffer if t") |
"Test trailing whitespace for file in current buffer if t.") |
118 |
(make-variable-buffer-local 'whitespace-check-buffer-trailing) |
(make-variable-buffer-local 'whitespace-check-buffer-trailing) |
119 |
(put 'whitespace-check-buffer-trailing 'permanent-local nil) |
(put 'whitespace-check-buffer-trailing 'permanent-local nil) |
120 |
|
|
121 |
(defvar whitespace-check-buffer-indent nil |
(defvar whitespace-check-buffer-indent nil |
122 |
"Test indentation whitespace for file in current buffer if t") |
"Test indentation whitespace for file in current buffer if t.") |
123 |
(make-variable-buffer-local 'whitespace-check-buffer-indent) |
(make-variable-buffer-local 'whitespace-check-buffer-indent) |
124 |
(put 'whitespace-check-buffer-indent 'permanent-local nil) |
(put 'whitespace-check-buffer-indent 'permanent-local nil) |
125 |
|
|
126 |
(defvar whitespace-check-buffer-spacetab nil |
(defvar whitespace-check-buffer-spacetab nil |
127 |
"Test Space-followed-by-TABS whitespace for file in current buffer if t") |
"Test Space-followed-by-TABS whitespace for file in current buffer if t.") |
128 |
(make-variable-buffer-local 'whitespace-check-buffer-spacetab) |
(make-variable-buffer-local 'whitespace-check-buffer-spacetab) |
129 |
(put 'whitespace-check-buffer-spacetab 'permanent-local nil) |
(put 'whitespace-check-buffer-spacetab 'permanent-local nil) |
130 |
|
|
131 |
(defvar whitespace-check-buffer-ateol nil |
(defvar whitespace-check-buffer-ateol nil |
132 |
"Test end-of-line whitespace for file in current buffer if t") |
"Test end-of-line whitespace for file in current buffer if t.") |
133 |
(make-variable-buffer-local 'whitespace-check-buffer-ateol) |
(make-variable-buffer-local 'whitespace-check-buffer-ateol) |
134 |
(put 'whitespace-check-buffer-ateol 'permanent-local nil) |
(put 'whitespace-check-buffer-ateol 'permanent-local nil) |
135 |
|
|
136 |
(defvar whitespace-highlighted-space nil |
(defvar whitespace-highlighted-space nil |
137 |
"The variable to store the extent to highlight") |
"The variable to store the extent to highlight.") |
138 |
(make-variable-buffer-local 'whitespace-highlighted-space) |
(make-variable-buffer-local 'whitespace-highlighted-space) |
139 |
(put 'whitespace-highlighted-space 'permanent-local nil) |
(put 'whitespace-highlighted-space 'permanent-local nil) |
140 |
|
|
142 |
(eval-when-compile |
(eval-when-compile |
143 |
(if (not (fboundp 'defgroup)) |
(if (not (fboundp 'defgroup)) |
144 |
(defmacro defgroup (sym memb doc &rest args) |
(defmacro defgroup (sym memb doc &rest args) |
145 |
"Null macro for defgroup in all versions of Emacs that don't define |
"Null macro for `defgroup' in all versions of Emacs that don't define it." |
|
defgroup" |
|
146 |
t)) |
t)) |
147 |
(if (not (fboundp 'defcustom)) |
(if (not (fboundp 'defcustom)) |
148 |
(defmacro defcustom (sym val doc &rest args) |
(defmacro defcustom (sym val doc &rest args) |
149 |
"Macro to alias defcustom to defvar in all versions of Emacs that |
"Macro to alias `defcustom' to `defvar' in all versions of Emacs that |
150 |
don't define defcustom" |
don't define it." |
151 |
`(defvar ,sym ,val ,doc)))) |
`(defvar ,sym ,val ,doc)))) |
152 |
|
|
153 |
(if (fboundp 'make-overlay) |
(if (fboundp 'make-overlay) |
179 |
:group 'convenience)) |
:group 'convenience)) |
180 |
|
|
181 |
(defcustom whitespace-check-leading-whitespace t |
(defcustom whitespace-check-leading-whitespace t |
182 |
"Flag to check leading whitespace. This is the global for the system. |
"Flag to check leading whitespace. This is the global for the system. |
183 |
It can be overriden by setting a buffer local variable |
It can be overriden by setting a buffer local variable |
184 |
`whitespace-check-buffer-leading'" |
`whitespace-check-buffer-leading'." |
185 |
:type 'boolean |
:type 'boolean |
186 |
:group 'whitespace) |
:group 'whitespace) |
187 |
|
|
188 |
(defcustom whitespace-check-trailing-whitespace t |
(defcustom whitespace-check-trailing-whitespace t |
189 |
"Flag to check trailing whitespace. This is the global for the system. |
"Flag to check trailing whitespace. This is the global for the system. |
190 |
It can be overriden by setting a buffer local variable |
It can be overriden by setting a buffer local variable |
191 |
`whitespace-check-buffer-trailing'" |
`whitespace-check-buffer-trailing'." |
192 |
:type 'boolean |
:type 'boolean |
193 |
:group 'whitespace) |
:group 'whitespace) |
194 |
|
|
195 |
(defcustom whitespace-check-spacetab-whitespace t |
(defcustom whitespace-check-spacetab-whitespace t |
196 |
"Flag to check space followed by a TAB. This is the global for the system. |
"Flag to check space followed by a TAB. This is the global for the system. |
197 |
It can be overriden by setting a buffer local variable |
It can be overriden by setting a buffer local variable |
198 |
`whitespace-check-buffer-spacetab'" |
`whitespace-check-buffer-spacetab'." |
199 |
:type 'boolean |
:type 'boolean |
200 |
:group 'whitespace) |
:group 'whitespace) |
201 |
|
|
205 |
:group 'whitespace) |
:group 'whitespace) |
206 |
|
|
207 |
(defcustom whitespace-check-indent-whitespace indent-tabs-mode |
(defcustom whitespace-check-indent-whitespace indent-tabs-mode |
208 |
"Flag to check indentation whitespace. This is the global for the system. |
"Flag to check indentation whitespace. This is the global for the system. |
209 |
It can be overriden by setting a buffer local variable |
It can be overriden by setting a buffer local variable |
210 |
`whitespace-check-buffer-indent'" |
`whitespace-check-buffer-indent'." |
211 |
:type 'boolean |
:type 'boolean |
212 |
:group 'whitespace) |
:group 'whitespace) |
213 |
|
|
217 |
:group 'whitespace) |
:group 'whitespace) |
218 |
|
|
219 |
(defcustom whitespace-check-ateol-whitespace t |
(defcustom whitespace-check-ateol-whitespace t |
220 |
"Flag to check end-of-line whitespace. This is the global for the system. |
"Flag to check end-of-line whitespace. This is the global for the system. |
221 |
It can be overriden by setting a buffer local variable |
It can be overriden by setting a buffer local variable |
222 |
`whitespace-check-buffer-ateol'" |
`whitespace-check-buffer-ateol'." |
223 |
:type 'boolean |
:type 'boolean |
224 |
:group 'whitespace) |
:group 'whitespace) |
225 |
|
|
241 |
:group 'whitespace) |
:group 'whitespace) |
242 |
|
|
243 |
(defcustom whitespace-abort-on-error nil |
(defcustom whitespace-abort-on-error nil |
244 |
"While writing a file, abort if the file is unclean. If |
"While writing a file, abort if the file is unclean. |
245 |
`whitespace-auto-cleanup' is set, that takes precedence over this |
If `whitespace-auto-cleanup' is set, that takes precedence over |
246 |
variable." |
this variable." |
247 |
:type 'boolean |
:type 'boolean |
248 |
:group 'whitespace) |
:group 'whitespace) |
249 |
|
|
276 |
tcl-mode tex-mode texinfo-mode |
tcl-mode tex-mode texinfo-mode |
277 |
vrml-mode xml-mode) |
vrml-mode xml-mode) |
278 |
|
|
279 |
"Major Modes in which we turn on whitespace checking. |
"Major modes in which we turn on whitespace checking. |
280 |
|
|
281 |
These are mostly programming and documentation modes. But you may add other |
These are mostly programming and documentation modes. But you may add other |
282 |
modes that you want whitespaces checked in by adding something like the |
modes that you want whitespaces checked in by adding something like the |