It has effect only if `face' (see above)
is present in `whitespace-style'.
- indentation::tab 8 or more SPACEs at beginning of line are
- visualized via faces.
+ indentation::tab `tab-width' or more SPACEs at beginning of line
+ are visualized via faces.
It has effect only if `face' (see above)
is present in `whitespace-style'.
It has effect only if `face' (see above)
is present in `whitespace-style'.
- indentation 8 or more SPACEs at beginning of line are
- visualized, if `indent-tabs-mode' (which see)
- is non-nil; otherwise, TABs at beginning of
- line are visualized via faces.
+ indentation `tab-width' or more SPACEs at beginning of line
+ are visualized, if `indent-tabs-mode' (which
+ see) is non-nil; otherwise, TABs at beginning
+ of line are visualized via faces.
It has effect only if `face' (see above)
is present in `whitespace-style'.
It has effect only if `face' (see above)
is present in `whitespace-style'.
- space-after-tab::tab 8 or more SPACEs after a TAB are
- visualized via faces.
+ space-after-tab::tab `tab-width' or more SPACEs after a TAB
+ are visualized via faces.
It has effect only if `face' (see above)
is present in `whitespace-style'.
- space-after-tab::space TABs are visualized when 8 or more
- SPACEs occur after a TAB, via faces.
+ space-after-tab::space TABs are visualized when `tab-width' or
+ more SPACEs occur after a TAB, via
+ faces.
It has effect only if `face' (see above)
is present in `whitespace-style'.
- space-after-tab 8 or more SPACEs after a TAB are
- visualized, if `indent-tabs-mode'
+ space-after-tab `tab-width' or more SPACEs after a TAB
+ are visualized, if `indent-tabs-mode'
(which see) is non-nil; otherwise,
the TABs are visualized via faces.
It has effect only if `face' (see above)
(defvar whitespace-indentation 'whitespace-indentation
- "Symbol face used to visualize 8 or more SPACEs at beginning of line.
-Used when `whitespace-style' includes the value `indentation'.")
+ "Symbol face used to visualize `tab-width' or more SPACEs at beginning of
+line. Used when `whitespace-style' includes the value `indentation'.")
(make-obsolete-variable 'whitespace-indentation "use the face instead." "24.4")
(defface whitespace-indentation
'((((class mono)) :inverse-video t :weight bold :underline t)
(t :background "yellow" :foreground "firebrick"))
- "Face used to visualize 8 or more SPACEs at beginning of line."
+ "Face used to visualize `tab-width' or more SPACEs at beginning of line."
:group 'whitespace)
(defface whitespace-big-indent
(defvar whitespace-space-after-tab 'whitespace-space-after-tab
- "Symbol face used to visualize 8 or more SPACEs after TAB.
+ "Symbol face used to visualize `tab-width' or more SPACEs after TAB.
Used when `whitespace-style' includes the value `space-after-tab'.")
(make-obsolete-variable 'whitespace-space-after-tab
"use the face instead." "24.4")
(defface whitespace-space-after-tab
'((((class mono)) :inverse-video t :weight bold :underline t)
(t :background "yellow" :foreground "firebrick"))
- "Face used to visualize 8 or more SPACEs after TAB."
+ "Face used to visualize `tab-width' or more SPACEs after TAB."
:group 'whitespace)
(defcustom whitespace-indentation-regexp
'("^\t*\\(\\( \\{%d\\}\\)+\\)[^\n\t]"
. "^ *\\(\t+\\)[^\n]")
- "Specify regexp for 8 or more SPACEs at beginning of line.
+ "Specify regexp for `tab-width' or more SPACEs at beginning of line.
It is a cons where the cons car is used for SPACEs visualization
and the cons cdr is used for TABs visualization.
(defcustom whitespace-space-after-tab-regexp
'("\t+\\(\\( \\{%d,\\}\\)+\\)"
. "\\(\t+\\) \\{%d,\\}")
- "Specify regexp for 8 or more SPACEs after TAB.
+ "Specify regexp for `tab-width' or more SPACEs after TAB.
It is a cons where the cons car is used for SPACEs visualization
and the cons cdr is used for TABs visualization.
If `whitespace-style' includes the value `empty', remove all
empty lines at beginning and/or end of buffer.
-3. 8 or more SPACEs at beginning of line.
+3. `tab-width' or more SPACEs at beginning of line.
If `whitespace-style' includes the value `indentation':
- replace 8 or more SPACEs at beginning of line by TABs, if
- `indent-tabs-mode' is non-nil; otherwise, replace TABs by
+ replace `tab-width' or more SPACEs at beginning of line by
+ TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by
SPACEs.
If `whitespace-style' includes the value `indentation::tab',
- replace 8 or more SPACEs at beginning of line by TABs.
+ replace `tab-width' or more SPACEs at beginning of line by TABs.
If `whitespace-style' includes the value `indentation::space',
replace TABs by SPACEs.
If `whitespace-style' includes the value `trailing', remove
all SPACEs or TABs at end of line.
-6. 8 or more SPACEs after TAB.
+6. `tab-width' or more SPACEs after TAB.
If `whitespace-style' includes the value `space-after-tab':
replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
otherwise, replace TABs by SPACEs.
current-prefix-arg)
mark-active)
;; PROBLEMs 1 and 2 are not handled in region
- ;; PROBLEM 3: 8 or more SPACEs at bol
+ ;; PROBLEM 3: `tab-width' or more SPACEs at bol
;; PROBLEM 4: SPACEs before TAB
;; PROBLEM 5: SPACEs or TABs at eol
- ;; PROBLEM 6: 8 or more SPACEs after TAB
+ ;; PROBLEM 6: `tab-width' or more SPACEs after TAB
(whitespace-cleanup-region (region-beginning) (region-end)))
;; whole buffer
(t
(when (re-search-forward
whitespace-empty-at-eob-regexp nil t)
(delete-region (match-beginning 1) (match-end 1)))))))
- ;; PROBLEM 3: 8 or more SPACEs at bol
+ ;; PROBLEM 3: `tab-width' or more SPACEs at bol
;; PROBLEM 4: SPACEs before TAB
;; PROBLEM 5: SPACEs or TABs at eol
- ;; PROBLEM 6: 8 or more SPACEs after TAB
+ ;; PROBLEM 6: `tab-width' or more SPACEs after TAB
(whitespace-cleanup-region (point-min) (point-max)))))
(defun whitespace-ensure-local-variables ()
The problems cleaned up are:
-1. 8 or more SPACEs at beginning of line.
+1. `tab-width' or more SPACEs at beginning of line.
If `whitespace-style' includes the value `indentation':
- replace 8 or more SPACEs at beginning of line by TABs, if
- `indent-tabs-mode' is non-nil; otherwise, replace TABs by
+ replace `tab-width' or more SPACEs at beginning of line by TABs,
+ if `indent-tabs-mode' is non-nil; otherwise, replace TABs by
SPACEs.
If `whitespace-style' includes the value `indentation::tab',
- replace 8 or more SPACEs at beginning of line by TABs.
+ replace `tab-width' or more SPACEs at beginning of line by TABs.
If `whitespace-style' includes the value `indentation::space',
replace TABs by SPACEs.
If `whitespace-style' includes the value `trailing', remove
all SPACEs or TABs at end of line.
-4. 8 or more SPACEs after TAB.
+4. `tab-width' or more SPACEs after TAB.
If `whitespace-style' includes the value `space-after-tab':
replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
otherwise, replace TABs by SPACEs.
tmp)
(save-excursion
(save-match-data ;FIXME: Why?
- ;; PROBLEM 1: 8 or more SPACEs at bol
+ ;; PROBLEM 1: `tab-width' or more SPACEs at bol
(cond
- ;; ACTION: replace 8 or more SPACEs at bol by TABs, if
+ ;; ACTION: replace `tab-width' or more SPACEs at bol by TABs, if
;; `indent-tabs-mode' is non-nil; otherwise, replace TABs
;; by SPACEs.
((memq 'indentation whitespace-style)
(delete-horizontal-space)
(unless (eolp)
(indent-to tmp)))))
- ;; ACTION: replace 8 or more SPACEs at bol by TABs.
+ ;; ACTION: replace `tab-width' or more SPACEs at bol by TABs.
((memq 'indentation::tab whitespace-style)
(whitespace-replace-action
'tabify rstart rend
(whitespace-replace-action
'delete-region rstart rend
whitespace-trailing-regexp 1))
- ;; PROBLEM 4: 8 or more SPACEs after TAB
+ ;; PROBLEM 4: `tab-width' or more SPACEs after TAB
(cond
- ;; ACTION: replace 8 or more SPACEs by TABs, if
+ ;; ACTION: replace `tab-width' or more SPACEs by TABs, if
;; `indent-tabs-mode' is non-nil; otherwise, replace TABs
;; by SPACEs.
((memq 'space-after-tab whitespace-style)
(whitespace-replace-action
(if whitespace-indent-tabs-mode 'tabify 'untabify)
rstart rend (whitespace-space-after-tab-regexp) 1))
- ;; ACTION: replace 8 or more SPACEs by TABs.
+ ;; ACTION: replace `tab-width' or more SPACEs by TABs.
((memq 'space-after-tab::tab whitespace-style)
(whitespace-replace-action
'tabify rstart rend
empty [] [] empty lines at beginning of buffer
empty [] [] empty lines at end of buffer
trailing [] [] SPACEs or TABs at end of line
- indentation [] [] 8 or more SPACEs at beginning of line
- indentation::tab [] [] 8 or more SPACEs at beginning of line
+ indentation [] [] >= `tab-width' SPACEs at beginning of line
+ indentation::tab [] [] >= `tab-width' SPACEs at beginning of line
indentation::space [] [] TABs at beginning of line
space-before-tab [] [] SPACEs before TAB
space-before-tab::tab [] [] SPACEs before TAB: SPACEs
space-before-tab::space [] [] SPACEs before TAB: TABs
- space-after-tab [] [] 8 or more SPACEs after TAB
- space-after-tab::tab [] [] 8 or more SPACEs after TAB: SPACEs
- space-after-tab::space [] [] 8 or more SPACEs after TAB: TABs
+ space-after-tab [] [] >= `tab-width' SPACEs after TAB
+ space-after-tab::tab [] [] >= `tab-width' SPACEs after TAB: SPACEs
+ space-after-tab::space [] [] >= `tab-width' SPACEs after TAB: TABs
indent-tabs-mode =
tab-width = \n\n"
empty [] [] empty lines at end of buffer
trailing [] [] SPACEs or TABs at end of line
indentation [] [] TABs at beginning of line
- indentation::tab [] [] 8 or more SPACEs at beginning of line
+ indentation::tab [] [] >= `tab-width' SPACEs at beginning of line
indentation::space [] [] TABs at beginning of line
space-before-tab [] [] SPACEs before TAB
space-before-tab::tab [] [] SPACEs before TAB: SPACEs
space-before-tab::space [] [] SPACEs before TAB: TABs
- space-after-tab [] [] 8 or more SPACEs after TAB
- space-after-tab::tab [] [] 8 or more SPACEs after TAB: SPACEs
- space-after-tab::space [] [] 8 or more SPACEs after TAB: TABs
+ space-after-tab [] [] >= `tab-width' SPACEs after TAB
+ space-after-tab::tab [] [] >= `tab-width' SPACEs after TAB: SPACEs
+ space-after-tab::space [] [] >= `tab-width' SPACEs after TAB: TABs
indent-tabs-mode =
tab-width = \n\n")
empty 1. empty lines at beginning of buffer.
empty 2. empty lines at end of buffer.
trailing 3. SPACEs or TABs at end of line.
- indentation 4. 8 or more SPACEs at beginning of line.
+ indentation 4. line starts with `tab-width' or more SPACEs.
space-before-tab 5. SPACEs before TAB.
- space-after-tab 6. 8 or more SPACEs after TAB.
+ space-after-tab 6. `tab-width' or more SPACEs after TAB.
* If `indent-tabs-mode' is nil:
empty 1. empty lines at beginning of buffer.
trailing 3. SPACEs or TABs at end of line.
indentation 4. TABS at beginning of line.
space-before-tab 5. SPACEs before TAB.
- space-after-tab 6. 8 or more SPACEs after TAB.
+ space-after-tab 6. `tab-width' or more SPACEs after TAB.
See `whitespace-style' for documentation.
See also `whitespace-cleanup' and `whitespace-cleanup-region' for