mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
Fix whitespace-space-after-tab-regexp
* lisp/whitespace.el (whitespace-space-after-tab-regexp) (whitespace-regexp): Match all the spaces after tabs for highlighting, not just the first tab-width. Fix whitespace-space-after-tab::space version so that it requires at least tab-width spaces, not just 1. (Bug#24745)
This commit is contained in:
parent
96f3ae900f
commit
a55c582fdb
1 changed files with 11 additions and 9 deletions
|
|
@ -737,8 +737,8 @@ Used when `whitespace-style' includes `empty'."
|
|||
|
||||
|
||||
(defcustom whitespace-space-after-tab-regexp
|
||||
'("\t+\\(\\( \\{%d\\}\\)+\\)"
|
||||
. "\\(\t+\\) +")
|
||||
'("\t+\\(\\( \\{%d,\\}\\)+\\)"
|
||||
. "\\(\t+\\) \\{%d,\\}")
|
||||
"Specify regexp for 8 or more SPACEs after TAB.
|
||||
|
||||
It is a cons where the cons car is used for SPACEs visualization
|
||||
|
|
@ -1566,13 +1566,15 @@ See also `tab-width'."
|
|||
|
||||
(defun whitespace-regexp (regexp &optional kind)
|
||||
"Return REGEXP depending on `whitespace-indent-tabs-mode'."
|
||||
(cond
|
||||
((or (eq kind 'tab)
|
||||
whitespace-indent-tabs-mode)
|
||||
(format (car regexp) whitespace-tab-width))
|
||||
((or (eq kind 'space)
|
||||
(not whitespace-indent-tabs-mode))
|
||||
(cdr regexp))))
|
||||
(format
|
||||
(cond
|
||||
((or (eq kind 'tab)
|
||||
whitespace-indent-tabs-mode)
|
||||
(car regexp))
|
||||
((or (eq kind 'space)
|
||||
(not whitespace-indent-tabs-mode))
|
||||
(cdr regexp)))
|
||||
whitespace-tab-width))
|
||||
|
||||
|
||||
(defun whitespace-indentation-regexp (&optional kind)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue