[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/relint cf39690 3/9: Clean-ups and safety fixes
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/relint cf39690 3/9: Clean-ups and safety fixes |
Date: |
Sat, 13 Apr 2019 12:51:29 -0400 (EDT) |
branch: externals/relint
commit cf3969064900b02f847a3a5497a4737884ccec4f
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Clean-ups and safety fixes
Require cl-lib instead of cl-seq, as suggested by Stefan Monnier.
Remove some functions with function args from relint--safe-functions.
Make one of them (alist-get) work by wrapping its function argument.
---
relint.el | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/relint.el b/relint.el
index 4db34d5..17b8be4 100644
--- a/relint.el
+++ b/relint.el
@@ -75,7 +75,7 @@
(require 'xr)
(require 'compile)
-(require 'cl-seq)
+(require 'cl-lib)
(defconst relint--error-buffer-name "*relint*")
@@ -223,7 +223,7 @@
eq eql equal
string-equal string= string< string-lessp string> string-greaterp
char-equal string-match-p
- string-match split-string replace-regexp-in-string
+ string-match split-string
wildcard-to-regexp
combine-and-quote-strings split-string-and-unquote
string-to-multibyte string-as-multibyte string-to-unibyte string-as-unibyte
@@ -236,7 +236,7 @@
string-to-list string-to-vector string-or-null-p
upcase downcase capitalize
purecopy copy-sequence copy-alist copy-tree
- assoc-default member-ignore-case alist-get
+ member-ignore-case
last butlast number-sequence
plist-get plist-member
1value
@@ -417,6 +417,17 @@
(apply (car form) args)
(error (throw 'relint-eval 'no-value))))))
+ ;; alist-get: wrap the optional fifth argument (testfn).
+ ((eq (car form) 'alist-get)
+ (let* ((all-args (mapcar #'relint--eval (cdr form)))
+ (args (if (< (length all-args) 5)
+ all-args
+ (append (butlast all-args (- (length all-args) 4))
+ (list (relint--wrap-function (nth 4 all-args)))))))
+ (condition-case nil
+ (apply (car form) args)
+ (error (throw 'relint-eval 'no-value)))))
+
((eq (car form) 'if)
(let ((condition (relint--eval (cadr form))))
(let ((then-part (nth 2 form))
- [elpa] externals/relint updated (fdfb2d7 -> a146c2c), Mattias Engdegård, 2019/04/13
- [elpa] externals/relint 973241a 1/9: Fix typo in comment, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint 88ccc9c 2/9: Stronger regexp-generating variable check, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint b8f617e 4/9: Various code simplifications, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint cf39690 3/9: Clean-ups and safety fixes,
Mattias Engdegård <=
- [elpa] externals/relint c315148 6/9: Treat #' and , @ correctly when finding position, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint 301b803 5/9: Use doc strings instead of comments preceding functions, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint 2471efb 8/9: Detailed diagnostics descriptions in README.org, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint a146c2c 9/9: Increment version to 1.7, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint 7db3e2e 7/9: Collect all functions, macros and aliases, Mattias Engdegård, 2019/04/13