[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e4e0ec4 049/184: counsel.el (counsel--file-name-filter): R
From: |
Oleh Krehel |
Subject: |
[elpa] master e4e0ec4 049/184: counsel.el (counsel--file-name-filter): Return "cat" on empty input |
Date: |
Wed, 16 Oct 2019 13:14:47 -0400 (EDT) |
branch: master
commit e4e0ec45b7bc77d40f7c2f89fb8b131eb7681e82
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel--file-name-filter): Return "cat" on empty input
"ag" errors on empty input.
---
counsel.el | 48 +++++++++++++++++++++++++-----------------------
1 file changed, 25 insertions(+), 23 deletions(-)
diff --git a/counsel.el b/counsel.el
index 742de0c..d976ae0 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1984,29 +1984,31 @@ one that exists will be used.")
"Return a command that filters a file list to match ivy candidates.
If USE-IGNORE is non-nil, try to generate a command that respects
`counsel-find-file-ignore-regexp'."
- (let ((regex ivy--old-re)
- (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) ""))))
- (let ((ignore-re (list (counsel--elisp-to-pcre
- counsel-find-file-ignore-regexp))))
- (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)))
+ (let ((regex ivy--old-re))
+ (if (= 0 (length regex))
+ "cat"
+ (let ((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) ""))))
+ (let ((ignore-re (list (counsel--elisp-to-pcre
+ counsel-find-file-ignore-regexp))))
+ (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)))))
(defun counsel--occur-cmd-find ()
(let ((cmd (format
- [elpa] master ae3576a 037/184: swiper.el (swiper-isearch): Fix scroll on RET, (continued)
- [elpa] master ae3576a 037/184: swiper.el (swiper-isearch): Fix scroll on RET, Oleh Krehel, 2019/10/16
- [elpa] master c4e0b0b 032/184: ivy-test.el (ivy-read-file-name-make-directory): Add, Oleh Krehel, 2019/10/16
- [elpa] master fdd2178 042/184: ivy.el (ivy--magic-tilde-directory): Use "~~" to move to local home, Oleh Krehel, 2019/10/16
- [elpa] master a9196a2 035/184: counsel.el (counsel-file-jump-args): Is now a list, Oleh Krehel, 2019/10/16
- [elpa] master e58231e 033/184: ivy.el (ivy-immediate-done): Fix for when "C-j" changed cwd, Oleh Krehel, 2019/10/16
- [elpa] master 0132ced 044/184: counsel.el: Run ispell-comments-and-strings, Oleh Krehel, 2019/10/16
- [elpa] master c4842ec 043/184: Fix typo: 'beggining', Oleh Krehel, 2019/10/16
- [elpa] master 28e9416 052/184: ivy.el (ivy--input): Fix for ediff, Oleh Krehel, 2019/10/16
- [elpa] master dd3e1c9 038/184: swiper.el (swiper--maybe-recenter): Refactor, Oleh Krehel, 2019/10/16
- [elpa] master 5ff5139 051/184: ivy.el (ivy-read-action-function): Allow to read actions using Ivy, Oleh Krehel, 2019/10/16
- [elpa] master e4e0ec4 049/184: counsel.el (counsel--file-name-filter): Return "cat" on empty input,
Oleh Krehel <=
- [elpa] master 17d9c70 036/184: counsel.el (counsel--find-return-list): Re-use counsel--call, Oleh Krehel, 2019/10/16
- [elpa] master 44c4bab 057/184: Restore use-ignore setting on ivy-resume, Oleh Krehel, 2019/10/16
- [elpa] master d3e4514 063/184: Remove obsolete aliases older than one year, Oleh Krehel, 2019/10/16
- [elpa] master 0be5b58 067/184: ivy.el (ivy-partial): Don't rely on subr-x, Oleh Krehel, 2019/10/16
- [elpa] master a986e4e 071/184: ivy.el (ivy--yank-handle-case-fold): Add, Oleh Krehel, 2019/10/16
- [elpa] master e41cbec 073/184: ivy.el (ivy-immediate-done): Fix parent dirs for read-directory-name, Oleh Krehel, 2019/10/16
- [elpa] master 3256447 076/184: ivy.el (ivy--partial-cd-for-single-directory): Extract, Oleh Krehel, 2019/10/16
- [elpa] master 03b3f82 075/184: ivy.el (ivy-partial): Use ivy--filter in place of all-completions, Oleh Krehel, 2019/10/16
- [elpa] master daf4683 081/184: ivy.el (ivy--directory-done): Inhibit distracting TRAMP message for /sudo::, Oleh Krehel, 2019/10/16
- [elpa] master 9e03f36 095/184: ivy-test.el: Turn two tests back on, Oleh Krehel, 2019/10/16