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

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

[elpa] master 0c30e3f 063/399: counsel.el: Minor compile history cleanup


From: Oleh Krehel
Subject: [elpa] master 0c30e3f 063/399: counsel.el: Minor compile history cleanup
Date: Sat, 20 Jul 2019 14:56:49 -0400 (EDT)

branch: master
commit 0c30e3fced7d5037da7523a82132769320c466a9
Author: Basil L. Contovounesios <address@hidden>
Commit: Basil L. Contovounesios <address@hidden>

    counsel.el: Minor compile history cleanup
    
    (counsel-compile-get-filtered-history):
    Simplify loop.  Do not mangle match data.  Fix variable names.
---
 counsel.el | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/counsel.el b/counsel.el
index 11f4b64..1f05795 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5236,16 +5236,15 @@ The optional BLDDIR is useful for other helpers that 
have found
 (defun counsel-compile-get-filtered-history (&optional dir)
   "Return a compile history relevant to current project."
   (let ((root (or dir (funcall counsel-compile-root-function)))
-        (kept-history))
-    (mapc
-     (lambda (hist)
-       (let ((srcdir (get-text-property 0 'srcdir hist))
-             (blddir (get-text-property 0 'blddir hist)))
-         (when (or (and srcdir (string-match srcdir root))
-                   (and blddir (string-match blddir root)))
-           (push hist kept-history))))
-     counsel-compile-history)
-    kept-history))
+        history)
+    (dolist (item counsel-compile-history)
+      (let ((srcdir (get-text-property 0 'srcdir item))
+            (blddir (get-text-property 0 'blddir item)))
+        ;; FIXME: File names are not regexps!
+        (when (or (and srcdir (string-match-p srcdir root))
+                  (and blddir (string-match-p blddir root)))
+          (push item history))))
+    history))
 
 (defun counsel--get-compile-candidates (&optional dir)
   "Return the list of compile commands.



reply via email to

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