[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master bc2dcbe 279/399: counsel.el (counsel--find-build-subdir):
From: |
Oleh Krehel |
Subject: |
[elpa] master bc2dcbe 279/399: counsel.el (counsel--find-build-subdir): Simplify |
Date: |
Sat, 20 Jul 2019 14:57:40 -0400 (EDT) |
branch: master
commit bc2dcbeae439a20ebaf6b270327999d258e16208
Author: Basil L. Contovounesios <address@hidden>
Commit: Basil L. Contovounesios <address@hidden>
counsel.el (counsel--find-build-subdir): Simplify
Re: #2077
---
counsel.el | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/counsel.el b/counsel.el
index df676da..86e5264 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5423,22 +5423,17 @@ subdirectories that builds may be invoked in."
(defun counsel--get-build-subdirs (blddir)
"Return all subdirs under BLDDIR sorted by modification time.
-If there are non-directory files in BLDDIR we also return BLDDIR in
- the list as it may also be a build directory."
+If there are non-directory files in BLDDIR, include BLDDIR in the
+list as it may also be a build directory."
(let* ((files (directory-files-and-attributes
blddir t directory-files-no-dot-files-regexp t))
- (filtered-files (cl-remove-if
- (lambda (f) (not (nth 1 f)))
- files)))
- ;; any non-dir files?
- (when (< (length filtered-files)
+ (dirs (cl-remove-if-not #'cl-second files)))
+ ;; Any non-dir files?
+ (when (< (length dirs)
(length files))
- (push (cons blddir (file-attributes blddir))
- filtered-files))
- (mapcar #'car
- (sort filtered-files
- (lambda (x y)
- (time-less-p (nth 6 y) (nth 6 x)))))))
+ (push (cons blddir (file-attributes blddir)) dirs))
+ (mapcar #'car (sort dirs (lambda (x y)
+ (time-less-p (nth 6 y) (nth 6 x)))))))
(defun counsel-compile-get-build-directories (&optional dir)
"Return a list of potential build directories."
- [elpa] master df0d980 267/399: Modify counsel-unicode-char's copy action to use actual result, (continued)
- [elpa] master df0d980 267/399: Modify counsel-unicode-char's copy action to use actual result, Oleh Krehel, 2019/07/20
- [elpa] master 19ff7cf 270/399: counsel.el (counsel-register-action): Tweak error, Oleh Krehel, 2019/07/20
- [elpa] master 4898a5e 272/399: counsel.el (counsel-compile): better handling for counsel--get-build-subdirs, Oleh Krehel, 2019/07/20
- [elpa] master e95a16b 275/399: Shrink ivy window after read action., Oleh Krehel, 2019/07/20
- [elpa] master 226171b 268/399: ivy.el (ivy--occur-insert-lines): Don't highlight the file name part, Oleh Krehel, 2019/07/20
- [elpa] master e8f9370 273/399: counsel.el (counsel-compile): nreverse recent history, Oleh Krehel, 2019/07/20
- [elpa] master b65cdb5 274/399: counsel.el (counsel-compile): track build dir for the benefit of M-i, Oleh Krehel, 2019/07/20
- [elpa] master a18de2f 269/399: counsel.el (counsel-register): Add, Oleh Krehel, 2019/07/20
- [elpa] master fbf654c 276/399: counsel.el (counsel-company): Rely on company-prefix if company-common is nil, Oleh Krehel, 2019/07/20
- [elpa] master 2410219 284/399: swiper.el (swiper-isearch-highlight-delay): New defcustom, Oleh Krehel, 2019/07/20
- [elpa] master bc2dcbe 279/399: counsel.el (counsel--find-build-subdir): Simplify,
Oleh Krehel <=
- [elpa] master 13da38a 287/399: ivy.el (ivy-help): Hide Org markup buffer-locally, Oleh Krehel, 2019/07/20
- [elpa] master 0134255 281/399: ivy.el (ivy--highlight-default): Use single face for adjacent groups, Oleh Krehel, 2019/07/20
- [elpa] master b7e9dfd 277/399: counsel.el: Fix a couple of typos, Oleh Krehel, 2019/07/20
- [elpa] master 92d5335 291/399: Add counsel-up-level command, Oleh Krehel, 2019/07/20
- [elpa] master 7e8622f 286/399: ivy.el (ivy-read-action): Fix, Oleh Krehel, 2019/07/20
- [elpa] master 0a26144 280/399: ivy.el (ivy--highlight-default): Handle unmatched groups, Oleh Krehel, 2019/07/20
- [elpa] master 8905b8b 278/399: counsel.el: Pacify byte-compiler, Oleh Krehel, 2019/07/20
- [elpa] master af5b594 283/399: ivy.el (ivy--occur-insert-lines): Fix typo bug, Oleh Krehel, 2019/07/20
- [elpa] master 04f56ca 282/399: ivy.el (ivy--recompute-index): Use configured flx candidate limit, Oleh Krehel, 2019/07/20
- [elpa] master e69ddc3 295/399: ivy.el (ivy-sort-function-buffer): Unify prefix and star-prefix matches, Oleh Krehel, 2019/07/20