branch: externals/relint
commit 501f87b2ae4616629df3a569e8ee762f71a7f2b1
Author: Mattias Engdegård <[email protected]>
Commit: Mattias Engdegård <[email protected]>
Evaluate `prog1' and `prog2'
---
relint.el | 11 +++++++++++
test/5.elisp | 6 ++++++
test/5.expected | 6 ++++++
3 files changed, 23 insertions(+)
diff --git a/relint.el b/relint.el
index 90fc73b..53acede 100644
--- a/relint.el
+++ b/relint.el
@@ -619,6 +619,17 @@ not be evaluated safely."
((memq head '(progn ignore-errors eval-when-compile eval-and-compile))
(relint--eval-body body))
+ ((eq head 'prog1)
+ (let ((val (relint--eval (car body))))
+ (relint--eval-body (cdr body))
+ val))
+
+ ((eq head 'prog2)
+ (relint--eval (car body))
+ (let ((val (relint--eval (cadr body))))
+ (relint--eval-body (cddr body))
+ val))
+
;; delete-dups: Work on a copy of the argument.
((eq head 'delete-dups)
(let ((arg (relint--eval (car body))))
diff --git a/test/5.elisp b/test/5.elisp
index 325a068..eb0e78c 100644
--- a/test/5.elisp
+++ b/test/5.elisp
@@ -67,3 +67,9 @@
(looking-at (let* ((x (list "u" "+" "v"))
(y (pop x)))
(string-join (append x (list y))))))
+
+(defun test-prog1 ()
+ (looking-at (prog1 "[UU]" "a" "b" "c")))
+
+(defun test-prog2 ()
+ (looking-at (prog2 "a" "[VV]" "b" "c")))
diff --git a/test/5.expected b/test/5.expected
index ed53589..d73b1be 100644
--- a/test/5.expected
+++ b/test/5.expected
@@ -31,3 +31,9 @@
5.elisp:67:15: In call to looking-at: Unescaped literal `+' (pos 0)
"+vu"
^
+5.elisp:72:15: In call to looking-at: Duplicated `U' inside character
alternative (pos 2)
+ "[UU]"
+ ..^
+5.elisp:75:15: In call to looking-at: Duplicated `V' inside character
alternative (pos 2)
+ "[VV]"
+ ..^