From b03f66acced06fda5ecc694e37b25bbf32ce4da2 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Fri, 21 Oct 2016 15:23:08 +0100 Subject: [PATCH 3/4] 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. --- lisp/whitespace.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lisp/whitespace.el b/lisp/whitespace.el index affddc3..f8dc950 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -730,8 +730,8 @@ whitespace-empty-at-eob-regexp (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 @@ -1559,13 +1559,15 @@ whitespace-replace-action (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) -- 2.7.4