branch: externals/relint commit 2d1f488de40c027f4b5a20caaba5b559cb413970 Author: Mattias Engdegård <matti...@acm.org> Commit: Mattias Engdegård <matti...@acm.org>
mapcar on non-list sequence Allow mapcar and mapcan to be run on any sequence that we can evaluate statically, not just lists. In particular, mapcar on strings to produce a regexp has been observed in the wild, and relint crashed without this change. --- relint.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/relint.el b/relint.el index 3d67093..e1d9c27 100644 --- a/relint.el +++ b/relint.el @@ -399,8 +399,11 @@ ;; The sequence argument may be missing a few arguments that we cannot ;; evaluate. ((memq (car form) '(mapcar mapcan)) - (let ((fun (relint--safe-function (relint--eval (cadr form)) nil)) - (seq (remq nil (relint--eval-list (caddr form))))) + (let* ((fun (relint--safe-function (relint--eval (cadr form)) nil)) + (arg (relint--eval-list (caddr form))) + (seq (if (listp arg) + (delq nil arg) + arg))) (if fun (condition-case err (funcall (car form) fun seq)