[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master a55c582 3/6: Fix whitespace-space-after-tab-regexp
From: |
Reuben Thomas |
Subject: |
[Emacs-diffs] master a55c582 3/6: Fix whitespace-space-after-tab-regexp |
Date: |
Thu, 3 Nov 2016 12:17:07 +0000 (UTC) |
branch: master
commit a55c582fdb98d87268fd11e5568d73010cfe0a45
Author: Reuben Thomas <address@hidden>
Commit: Reuben Thomas <address@hidden>
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)
---
lisp/whitespace.el | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 1986b52..2cf014c 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -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)
- [Emacs-diffs] master updated (76e297c -> 86bec41), Reuben Thomas, 2016/11/03
- [Emacs-diffs] master 0a5ab4d 1/6: Fix bob/eob checks, Reuben Thomas, 2016/11/03
- [Emacs-diffs] master 2350bb9 4/6: Make whitespace-report-region respect current settings, Reuben Thomas, 2016/11/03
- [Emacs-diffs] master 86bec41 6/6: Stop force parameter of whitespace-report-region having global effect, Reuben Thomas, 2016/11/03
- [Emacs-diffs] master 50bba7f 5/6: Document use of `tab-width', Reuben Thomas, 2016/11/03
- [Emacs-diffs] master a55c582 3/6: Fix whitespace-space-after-tab-regexp,
Reuben Thomas <=
- [Emacs-diffs] master 96f3ae9 2/6: Remove duplicate documentation, Reuben Thomas, 2016/11/03