branch: externals/relint commit d4d8f97e0444bee4d98c45be8ae6a5b4e5263d35 Author: Mattias Engdegård <matti...@acm.org> Commit: Mattias Engdegård <matti...@acm.org>
Eval mapcar and mapcan with partial-evaluated lists Evaluate mapcar and mapcan even if their list argument isn't fully evaluated, so a single missing element won't spoil analysis of a whole list. This change allows auto-mode-alist to be analysed. --- trawl.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/trawl.el b/trawl.el index 3193f26..ed7b630 100644 --- a/trawl.el +++ b/trawl.el @@ -290,7 +290,12 @@ ((memq (car form) '(mapcar mapconcat mapcan)) (let ((fun (cadr form))) (if (trawl--safe-function fun) - (let ((args (mapcar #'trawl--eval (cddr form)))) + (let ((args + ;; Use trawl--eval-list when we believe that missing + ;; elements may be acceptable. + (if (eq (car form) 'mapconcat) + (mapcar #'trawl--eval (cddr form)) + (delq nil (mapcar #'trawl--eval-list (cddr form)))))) (if (memq 'no-value args) 'no-value (condition-case nil