emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/relint d4d8f97 11/44: Eval mapcar and mapcan with parti


From: Mattias Engdegård
Subject: [elpa] externals/relint d4d8f97 11/44: Eval mapcar and mapcan with partial-evaluated lists
Date: Tue, 26 Mar 2019 12:57:26 -0400 (EDT)

branch: externals/relint
commit d4d8f97e0444bee4d98c45be8ae6a5b4e5263d35
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>

    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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]