[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/xr 018a994 4/5: Warn about [[:class:]] in skip-sets
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/xr 018a994 4/5: Warn about [[:class:]] in skip-sets |
Date: |
Mon, 1 Apr 2019 08:53:26 -0400 (EDT) |
branch: externals/xr
commit 018a994f9cb5d2fcd9dcfcabef40f492b7bb952b
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Warn about [[:class:]] in skip-sets
This check overlaps the general "[...]" check, but neither is a subset
of the other. It's possible to get both; no harm in that.
---
xr-test.el | 2 ++
xr.el | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/xr-test.el b/xr-test.el
index 644eedf..dbcf84c 100644
--- a/xr-test.el
+++ b/xr-test.el
@@ -425,6 +425,8 @@
'((2 . "Unnecessarily escaped `$'"))))
(should (equal (xr-skip-set-lint "[^a-z]")
'((0 . "Suspect skip set framed in `[...]'"))))
+ (should (equal (xr-skip-set-lint "[[:space:]].")
+ '((0 . "Suspect character class framed in `[...]'"))))
(should (equal (xr-skip-set-lint "")
'((0 . "Empty set matches nothing"))))
(should (equal (xr-skip-set-lint "^")
diff --git a/xr.el b/xr.el
index d2a65d1..8b7c3b6 100644
--- a/xr.el
+++ b/xr.el
@@ -647,6 +647,11 @@
lower multibyte nonascii print punct space
unibyte upper word xdigit))
(error "No character class `%s'" (match-string 0)))
+ ;; Another useful ad-hoc check.
+ (when (and (eq (char-before) ?\[)
+ (eq (char-after (match-end 0)) ?\]))
+ (xr--report warnings (1- (point))
+ "Suspect character class framed in `[...]'"))
(when (memq sym classes)
(xr--report warnings (point)
(format "Duplicated character class `%s'"
- [elpa] externals/xr updated (2136a7d -> 2aec9fd), Mattias Engdegård, 2019/04/01
- [elpa] externals/xr 7612347 2/5: URL to repository and to relint, Mattias Engdegård, 2019/04/01
- [elpa] externals/xr 018a994 4/5: Warn about [[:class:]] in skip-sets,
Mattias Engdegård <=
- [elpa] externals/xr 5b53cc9 3/5: Warn about two-character ranges like [*-+], Mattias Engdegård, 2019/04/01
- [elpa] externals/xr 4525d39 1/5: Comment cosmetics, and add a README., Mattias Engdegård, 2019/04/01
- [elpa] externals/xr 2aec9fd 5/5: Increment version to 1.10; add News section, Mattias Engdegård, 2019/04/01