[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/relint 6a07508 10/23: Handle rx `eval' form correctly
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/relint 6a07508 10/23: Handle rx `eval' form correctly |
Date: |
Sun, 29 Sep 2019 15:34:52 -0400 (EDT) |
branch: externals/relint
commit 6a07508cc257227028d285f971d39fa4aea22283
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Handle rx `eval' form correctly
The `eval' argument can yield an arbitrary rx form, not just a string.
---
relint.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/relint.el b/relint.el
index d1654fb..fab4e44 100644
--- a/relint.el
+++ b/relint.el
@@ -405,7 +405,14 @@ alternatives. They may still require wrapping their
function arguments.")
rx)
;; We ignore the differences in evaluation time between `eval' and
;; `regexp', and just use what environment we have.
- ((memq (car rx) '(literal eval regexp regex))
+ ((eq (car rx) 'eval)
+ (let ((arg (relint--eval (cadr rx))))
+ ;; For safety, make sure the result isn't another evaluating form.
+ (when (and (consp arg)
+ (memq (car arg) '(literal eval regexp regex)))
+ (throw 'relint-eval 'no-value))
+ arg))
+ ((memq (car rx) '(literal regexp regex))
(let ((arg (relint--eval (cadr rx))))
(if (stringp arg)
(list (car rx) arg)
- [elpa] externals/relint 3f3408d 07/23: Check both car and cdr of items in -regexp-alist variables, (continued)
- [elpa] externals/relint 3f3408d 07/23: Check both car and cdr of items in -regexp-alist variables, Mattias Engdegård, 2019/09/29
- [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 <=
- [elpa] externals/relint 3a7e82a 05/23: Track some mutation of local variables in phase 2, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint bc1b5a8 16/23: Add word-search-regexp to the list of regexp generating functions, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint b890b5a 15/23: Track mutation in push and lambda in phase 2, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 02c5dd2 13/23: Prepare for easier testability, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 60d5627 21/23: Lazy evaluation of global variables, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint b0f0bee 23/23: Increment version to 1.11, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 501f87b 20/23: Evaluate `prog1' and `prog2', Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 6212b6f 22/23: Evaluate more functions and macros, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 7e6b8bf 14/23: Add tests, Mattias Engdegård, 2019/09/29