[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/relint 3f3408d 07/23: Check both car and cdr of items i
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/relint 3f3408d 07/23: Check both car and cdr of items in -regexp-alist variables |
Date: |
Sun, 29 Sep 2019 15:34:51 -0400 (EDT) |
branch: externals/relint
commit 3f3408df3d4afccbdff41040b2272f251cbd8e37
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Check both car and cdr of items in -regexp-alist variables
We don't know whether the alist maps from or to regexps, so check both.
---
relint.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/relint.el b/relint.el
index 8f34195..2886e00 100644
--- a/relint.el
+++ b/relint.el
@@ -856,6 +856,15 @@ evaluated are nil."
(stringp (car elem)))
(relint--check-re-string (car elem) name file pos path)))))
+(defun relint--check-alist-any (form name file pos path)
+ "Check an alist whose cars or cdrs may be regexps."
+ (dolist (elem (relint--get-list form))
+ (when (consp elem)
+ (when (stringp (car elem))
+ (relint--check-re-string (car elem) name file pos path))
+ (when (stringp (cdr elem))
+ (relint--check-re-string (cdr elem) name file pos path)))))
+
(defun relint--check-alist-cdr (form name file pos path)
"Check an alist whose cdrs are regexps."
(dolist (elem (relint--get-list form))
@@ -1315,7 +1324,7 @@ directly."
((string-match-p (rx (or "-regexp" "-regex" "-re" "-pattern")
"-alist" eos)
(symbol-name name))
- (relint--check-list-any re-arg name file pos (cons 2 path))
+ (relint--check-alist-any re-arg name file pos (cons 2 path))
(push name relint--checked-variables))
((string-match-p (rx "-mode-alist" eos)
(symbol-name name))
- [elpa] externals/relint updated (0bf6883 -> b0f0bee), Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 099b59f 01/23: Reorder strings in regexp for more efficient matching, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 1ec2d8b 02/23: More elaborate parsing of doc strings of global variables, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 95b3c07 08/23: Add `xor' and bitwise operations to the list of safe functions, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 3f3408d 07/23: Check both car and cdr of items in -regexp-alist variables,
Mattias Engdegård <=
- [elpa] externals/relint 5142c86 09/23: Fix function evaluation bug, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 43c4644 06/23: Correct naming, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint e11b871 12/23: More robust scanning of format strings for mixup check, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 956a15b 17/23: Fix defun parsing, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 3a27cff 18/23: Handle mutation of local variables in evaluation, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint d2b7194 19/23: Evaluate `dolist' and `while', Mattias Engdegård, 2019/09/29
- [elpa] externals/relint b2a86b8 04/23: Fix typo in message description and clarify, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 1cb021a 03/23: Remove relint--eval-error, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 5137ec6 11/23: Evaluate keywords correctly, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 6a07508 10/23: Handle rx `eval' form correctly, Mattias Engdegård, 2019/09/29