[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a9196a2 035/184: counsel.el (counsel-file-jump-args): Is n
From: |
Oleh Krehel |
Subject: |
[elpa] master a9196a2 035/184: counsel.el (counsel-file-jump-args): Is now a list |
Date: |
Wed, 16 Oct 2019 13:14:44 -0400 (EDT) |
branch: master
commit a9196a277505f638934f013b485b2f9dd7be0637
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-file-jump-args): Is now a list
* counsel.el (counsel-dired-jump-args): Now a list. Removing the
single quotes around '.git' breaks user's config anyway.
A user warning about the new format is added.
(counsel--find-return-list): Simplify. Use `process-file'.
TODO: merge this with `counsel--command'.
Re #2120
---
counsel.el | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/counsel.el b/counsel.el
index f7da46f..2c8514b 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2549,21 +2549,22 @@ FZF-PROMPT, if non-nil, is passed as `ivy-read' prompt
argument."
(message (cdr x)))
:caller 'counsel-rpm)))
-(defun counsel--find-return-list (args skip-first)
+(defun counsel--find-return-list (args)
+ (unless (listp args)
+ (user-error "`counsel-file-jump-args' is a list now, please customize
accordingly."))
(with-temp-buffer
- (apply #'call-process find-program nil (current-buffer) nil args)
+ (apply #'process-file find-program nil (current-buffer) nil args)
(goto-char (point-min))
- (when skip-first
- (forward-line))
- (let ((start (point)) files)
- (while (search-forward "\n" nil t)
- (push (buffer-substring (+ 2 start) (1- (point))) files)
- (setq start (point)))
- files)))
-
-(defcustom counsel-file-jump-args ". -name .git -prune -o -type f -print"
+ (let (files)
+ (while (< (point) (point-max))
+ (push (buffer-substring
+ (+ 2 (line-beginning-position)) (line-end-position)) files)
+ (forward-line 1))
+ (nreverse files))))
+
+(defcustom counsel-file-jump-args (split-string ". -name .git -prune -o -type
f -print")
"Arguments for the `find-command' when using `counsel-file-jump'."
- :type 'string)
+ :type '(repeat string))
;;** `counsel-file-jump'
;;;###autoload
@@ -2579,7 +2580,7 @@ INITIAL-DIRECTORY, if non-nil, is used as the root
directory for search."
(counsel-require-program find-program)
(let ((default-directory (or initial-directory default-directory)))
(ivy-read "Find file: "
- (counsel--find-return-list (split-string counsel-file-jump-args)
nil)
+ (counsel--find-return-list counsel-file-jump-args)
:matcher #'counsel--find-file-matcher
:initial-input initial-input
:action #'find-file
@@ -2595,9 +2596,9 @@ INITIAL-DIRECTORY, if non-nil, is used as the root
directory for search."
(dired (or (file-name-directory x) default-directory)))
"open in dired")))
-(defcustom counsel-dired-jump-args ". -name .git -prune -o -type d -print"
+(defcustom counsel-dired-jump-args (split-string ". -name .git -prune -o -type
d -print")
"Arguments for the `find-command' when using `counsel-dired-jump'."
- :type 'string)
+ :type '(repeat string))
;;** `counsel-dired-jump'
;;;###autoload
@@ -2613,7 +2614,8 @@ INITIAL-DIRECTORY, if non-nil, is used as the root
directory for search."
(counsel-require-program find-program)
(let ((default-directory (or initial-directory default-directory)))
(ivy-read "Find directory: "
- (counsel--find-return-list (split-string
counsel-dired-jump-args) t)
+ (cdr
+ (counsel--find-return-list counsel-dired-jump-args))
:matcher #'counsel--find-file-matcher
:initial-input initial-input
:action (lambda (d) (dired-jump nil (expand-file-name d)))
- [elpa] master f30c6e1 022/184: swiper.el: Fix overlay faces using regex-ignore-order, (continued)
- [elpa] master f30c6e1 022/184: swiper.el: Fix overlay faces using regex-ignore-order, Oleh Krehel, 2019/10/16
- [elpa] master 9c4cdb7 025/184: swiper.el (swiper-isearch-action): Fix for ivy-occur, Oleh Krehel, 2019/10/16
- [elpa] master ed1ba4e 028/184: Makefile (deps): Add target, Oleh Krehel, 2019/10/16
- [elpa] master b5e869e 026/184: swiper.el (swiper--occur-cands): Fix wgrep, Oleh Krehel, 2019/10/16
- [elpa] master 6928beb 031/184: ivy-test.el (ivy-read-file-name-in-buffer-visiting-file): Passes, Oleh Krehel, 2019/10/16
- [elpa] master 35415e3 027/184: ivy-test.el (ivy-swiper-wgrep): Add test, Oleh Krehel, 2019/10/16
- [elpa] master fb78c3f 045/184: swiper.el: Run ispell-comments-and-strings, Oleh Krehel, 2019/10/16
- [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 <=
- [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, 2019/10/16
- [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