[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d91f61d 378/399: counsel.el (counsel--split-string): Extra
From: |
Oleh Krehel |
Subject: |
[elpa] master d91f61d 378/399: counsel.el (counsel--split-string): Extract |
Date: |
Sat, 20 Jul 2019 14:58:03 -0400 (EDT) |
branch: master
commit d91f61ddd68cb031b165f0290e0c453d779708f6
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel--split-string): Extract
---
counsel.el | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/counsel.el b/counsel.el
index 9d49719..eebd33d 100644
--- a/counsel.el
+++ b/counsel.el
@@ -201,6 +201,9 @@ respectively."
(defvar counsel-grep-last-line nil)
+(defun counsel--split-string (&optional str)
+ (split-string (or str (buffer-string)) counsel-async-split-string-re t))
+
(defun counsel--async-sentinel (process _msg)
"Sentinel function for an asynchronous counsel PROCESS."
(when (eq (process-status process) 'exit)
@@ -209,7 +212,7 @@ respectively."
(ivy--set-candidates
(ivy--sort-maybe
(with-current-buffer (process-buffer process)
- (split-string (buffer-string) counsel-async-split-string-re t))))
+ (counsel--split-string))))
(setq counsel-grep-last-line nil)
(when counsel--async-start
(setq counsel--async-duration
@@ -253,9 +256,7 @@ Update the minibuffer with the amount of lines collected
every
(with-current-buffer (process-buffer process)
(setq numlines (count-lines (point-min) (point-max)))
(ivy--set-candidates
- (let ((lines (split-string (buffer-string)
- counsel-async-split-string-re
- t)))
+ (let ((lines (counsel--split-string)))
(if (stringp counsel-async-ignore-re)
(cl-remove-if (lambda (line)
(string-match-p counsel-async-ignore-re line))
@@ -1519,10 +1520,7 @@ When REVERT is non-nil, regenerate the current
*ivy-occur* buffer."
" ")))
(cmd (concat (format counsel-git-grep-cmd positive-pattern)
negative-patterns))
cands)
- (setq cands (split-string
- (shell-command-to-string cmd)
- counsel-async-split-string-re
- t))
+ (setq cands (counsel--split-string (shell-command-to-string cmd)))
;; Need precise number of header lines for `wgrep' to work.
(insert (format "-*- mode:grep; default-directory: %S -*-\n\n\n"
default-directory))
@@ -2760,9 +2758,7 @@ CALLER is passed to `ivy-read'."
(concat
switches
(shell-quote-argument regex))))
- (cands (split-string (shell-command-to-string cmd)
- counsel-async-split-string-re
- t)))
+ (cands (counsel--split-string (shell-command-to-string cmd))))
;; Need precise number of header lines for `wgrep' to work.
(insert (format "-*- mode:grep; default-directory: %S -*-\n\n\n"
default-directory))
- [elpa] master 180d329 365/399: swiper.el (swiper--re-builder): Improve for char-fold-to-regexp, (continued)
- [elpa] master 180d329 365/399: swiper.el (swiper--re-builder): Improve for char-fold-to-regexp, Oleh Krehel, 2019/07/20
- [elpa] master 4e9e310 368/399: ivy.el (ivy-read): Fix swiper-query-replace not working, Oleh Krehel, 2019/07/20
- [elpa] master a0b71a1 362/399: ivy.el (ivy--magic-tilde-directory): Cd remote "~" on "~", Oleh Krehel, 2019/07/20
- [elpa] master 3af75cf 364/399: swiper.el (swiper--positive-regexps): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 916e281 367/399: ivy.el (ivy-read): Fix bad refactor, Oleh Krehel, 2019/07/20
- [elpa] master 1ea4ebb 370/399: Fix minor typo, Oleh Krehel, 2019/07/20
- [elpa] master 2fa7cec 366/399: ivy-test.el (swiper--re-builder): Add test, Oleh Krehel, 2019/07/20
- [elpa] master 57e77a5 372/399: counsel.el (counsel-git-log-split-string-re): Change., Oleh Krehel, 2019/07/20
- [elpa] master 72a827a 373/399: counsel.el (counsel-git-log): Add additional action., Oleh Krehel, 2019/07/20
- [elpa] master 259cf07 374/399: Fix ivy-previous-line-or-history, Oleh Krehel, 2019/07/20
- [elpa] master d91f61d 378/399: counsel.el (counsel--split-string): Extract,
Oleh Krehel <=
- [elpa] master e858b10 371/399: Add autoload for various commands, Oleh Krehel, 2019/07/20
- [elpa] master 75f4146 377/399: ivy.el (ivy-occur-revert-buffer): Stay on the same line, Oleh Krehel, 2019/07/20
- [elpa] master 3ec81dc 369/399: ivy-test.el (swiper--re-builder-char-fold): Split away, Oleh Krehel, 2019/07/20
- [elpa] master 98127be 375/399: ivy.el (ivy-format-functions-alist): Fix defcustom type, Oleh Krehel, 2019/07/20
- [elpa] master 1bb48ae 376/399: swiper.el: Add :group for faces, Oleh Krehel, 2019/07/20
- [elpa] master 3380b6f 382/399: swiper.el (swiper--avy-goto): Works for swiper-isearch, Oleh Krehel, 2019/07/20
- [elpa] master bd53ada 379/399: counsel.el (counsel-async-split-string-re-alist): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 0703a70 380/399: counsel.el (counsel-async-ignore-re-alist): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 59603df 383/399: swiper.el (swiper--avy-goto): Fix for a small amount of cands, Oleh Krehel, 2019/07/20
- [elpa] master 5f030d5 381/399: counsel.el (counsel--git-log-format-function): Add, Oleh Krehel, 2019/07/20