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

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

[elpa] master 1439e8d 064/399: counsel.el: Simplify compile build dir co


From: Oleh Krehel
Subject: [elpa] master 1439e8d 064/399: counsel.el: Simplify compile build dir collection
Date: Sat, 20 Jul 2019 14:56:50 -0400 (EDT)

branch: master
commit 1439e8dde2b2338e757c0efe24995b7d7f2991f5
Author: Basil L. Contovounesios <address@hidden>
Commit: Basil L. Contovounesios <address@hidden>

    counsel.el: Simplify compile build dir collection
    
    (counsel-compile-get-build-directories):
    Remove one level of string consing.
---
 counsel.el | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/counsel.el b/counsel.el
index 1f05795..5072dd9 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5218,19 +5218,15 @@ The optional BLDDIR is useful for other helpers that 
have found
 (defun counsel-compile-get-build-directories (&optional dir)
   "Return a list of potential build directories."
   (let* ((srcdir (or dir (funcall counsel-compile-root-function)))
-         (blddir (counsel--find-build-subdir srcdir)))
-    (when blddir
-      (mapcar
-       (lambda (sd)
-         (propertize
-          (concat
-           (propertize "select build in "
-                       'face 'font-lock-warning-face)
-           (propertize sd 'face 'dired-directory))
-          'srcdir srcdir
-          'blddir sd
-          'recursive 't))
-       (counsel--get-build-subdirs blddir)))))
+         (blddir (counsel--find-build-subdir srcdir))
+         (props `(srcdir ,srcdir blddir ,blddir recursive t)))
+    (mapcar (lambda (s)
+              (setq s (concat (propertize "Select build in "
+                                          'face 'font-lock-warning-face)
+                              (propertize s 'face 'dired-directory)))
+              (add-text-properties 0 (length s) props s)
+              s)
+            (and blddir (counsel--get-build-subdirs blddir)))))
 
 ;; No easy way to make directory local, would buffer local make more sense?
 (defun counsel-compile-get-filtered-history (&optional dir)



reply via email to

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