[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 468e914 109/399: counsel.el (counsel--file-name-filter): C
From: |
Oleh Krehel |
Subject: |
[elpa] master 468e914 109/399: counsel.el (counsel--file-name-filter): Clean up style |
Date: |
Sat, 20 Jul 2019 14:56:59 -0400 (EDT) |
branch: master
commit 468e914330b1e07c01ce646d8d5c63b68971900e
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel--file-name-filter): Clean up style
Don't use `and' for side effects.
Avoid overwriting `cmd' binding.
Re #1984
---
counsel.el | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/counsel.el b/counsel.el
index 828ae44..742f334 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1877,21 +1877,23 @@ If USE-IGNORE is non-nil, try to generate a command
that respects
(let ((regex ivy--old-re)
(ignore-re (list (counsel--elisp-to-pcre
counsel-find-file-ignore-regexp)))
- (cmd (cl-find-if
- (lambda (x)
- (executable-find
- (car (split-string (car x)))))
- counsel-file-name-filter-alist)))
- (and use-ignore ivy-use-ignore
- counsel-find-file-ignore-regexp
- (cdr cmd)
- (not (string-match-p "\\`\\." ivy-text))
- (not (string-match-p counsel-find-file-ignore-regexp
- (or (car ivy--old-cands) "")))
- (setq regex (if (stringp regex)
- (list ignore-re (cons regex t))
- (cons ignore-re regex))))
- (setq cmd (format (car cmd) (counsel--elisp-to-pcre regex (cdr cmd))))
+ (filter-cmd (cl-find-if
+ (lambda (x)
+ (executable-find
+ (car (split-string (car x)))))
+ counsel-file-name-filter-alist))
+ cmd)
+ (when (and use-ignore ivy-use-ignore
+ counsel-find-file-ignore-regexp
+ (cdr filter-cmd)
+ (not (string-match-p "\\`\\." ivy-text))
+ (not (string-match-p counsel-find-file-ignore-regexp
+ (or (car ivy--old-cands) ""))))
+ (setq regex (if (stringp regex)
+ (list ignore-re (cons regex t))
+ (cons ignore-re regex))))
+ (setq cmd (format (car filter-cmd)
+ (counsel--elisp-to-pcre regex (cdr filter-cmd))))
(if (string-match-p "csh\\'" shell-file-name)
(replace-regexp-in-string "\\?!" "?\\\\!" cmd)
cmd)))
- [elpa] master 2356a1d 091/399: ivy-test.el (counsel--grep-regex): Extend test, (continued)
- [elpa] master 2356a1d 091/399: ivy-test.el (counsel--grep-regex): Extend test, Oleh Krehel, 2019/07/20
- [elpa] master cdd7ada 094/399: counsel.el (counsel-url-expand): Avoid null error, Oleh Krehel, 2019/07/20
- [elpa] master 089107a 099/399: counsel.el (counsel-ag): Add a keyword argument caller, Oleh Krehel, 2019/07/20
- [elpa] master 776fbb7 103/399: Make ivy-switch-buffer-occur work with multi-pass regex builders, Oleh Krehel, 2019/07/20
- [elpa] master 8b4c939 100/399: counsel.el (counsel-cd): Add, Oleh Krehel, 2019/07/20
- [elpa] master 0c8cfe8 106/399: ivy-hydra.el (ivy-dispatching-done-idle): Add, Oleh Krehel, 2019/07/20
- [elpa] master 4c52362 110/399: swiper.el (swiper-occur): Make wgrep work for narrowed buffers, Oleh Krehel, 2019/07/20
- [elpa] master 8c1a2fa 107/399: Allow all re-builders to use ivy-highlight-grep-commands, Oleh Krehel, 2019/07/20
- [elpa] master 78b62f2 102/399: README.md: Mention char-fold-to-regexp, Oleh Krehel, 2019/07/20
- [elpa] master a601e40 104/399: counsel.el (counsel-org-goto-all): Use org-mode outline settings, Oleh Krehel, 2019/07/20
- [elpa] master 468e914 109/399: counsel.el (counsel--file-name-filter): Clean up style,
Oleh Krehel <=
- [elpa] master 6373a48 105/399: counsel.el: Fix compiler warning, Oleh Krehel, 2019/07/20
- [elpa] master 164fecb 108/399: Make find-file-occur work with multi-pass regex builders, Oleh Krehel, 2019/07/20
- [elpa] master 3b677d4 113/399: counsel.el (counsel-file-jump-args): Fix dotfiles not being shown, Oleh Krehel, 2019/07/20
- [elpa] master ffa2d8f 112/399: counsel.el (counsel-unicode-char): Fix sorting, Oleh Krehel, 2019/07/20
- [elpa] master 18d7f84 117/399: counsel.el (counsel-yank-pop-action): Also works for strings, Oleh Krehel, 2019/07/20
- [elpa] master c56ad2a 114/399: ivy-hydra.el (ivy-dispatching-done-hydra): Improve, Oleh Krehel, 2019/07/20
- [elpa] master 344aebc 116/399: counsel.el (counsel-dired-jump): Improve, Oleh Krehel, 2019/07/20
- [elpa] master b27ef9e 111/399: counsel.el (counsel-git-cands): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 1b5af1e 115/399: counsel.el (counsel-file-jump-args): Adjust, Oleh Krehel, 2019/07/20
- [elpa] master 05763ae 121/399: counsel.el (counsel-git): Fix default-directory, Oleh Krehel, 2019/07/20