[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6f0f32f 084/399: counsel.el (counsel-git-grep-count-functi
From: |
Oleh Krehel |
Subject: |
[elpa] master 6f0f32f 084/399: counsel.el (counsel-git-grep-count-function): Promote to defcustom |
Date: |
Sat, 20 Jul 2019 14:56:54 -0400 (EDT) |
branch: master
commit 6f0f32fe374df2e3e356bdef83d27e71efa79231
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-git-grep-count-function): Promote to defcustom
* counsel.el (counsel--git-grep-count-func):
(counsel--git-grep-count-func-default): Add obsolete aliases.
Re #1402
---
counsel.el | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/counsel.el b/counsel.el
index 450bab2..bae9b2b 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1409,7 +1409,7 @@ COMMAND fails. Obey file handlers based on
`default-directory'."
(signal (car status) (cdr status))))
(delete-file stderr))))
-(defun counsel--git-grep-count-func-default ()
+(defun counsel-git-grep-count-function-du ()
"Default function to calculate `counsel--git-grep-count'."
(or (unless (eq system-type 'windows-nt)
(ignore-errors
@@ -1417,8 +1417,20 @@ COMMAND fails. Obey file handlers based on
`default-directory'."
(read (counsel--call "du" "-s" git-dir)))))
0))
-(defvar counsel--git-grep-count-func #'counsel--git-grep-count-func-default
- "Defun to calculate `counsel--git-grep-count' for `counsel-git-grep'.")
+(defcustom counsel-git-grep-count-function #'counsel-git-grep-count-function-du
+ "Defun to calculate `counsel--git-grep-count' for `counsel-git-grep'."
+ :type '(choice
+ (const :tag "Grep always does filtering."
+ (lambda () most-positive-fixnum))
+ (const :tag "Emacs always does filtering."
+ (lambda () 0))
+ (const :tag "Decide on Grep or Emacs based on .git directory size."
+ 'counsel-git-grep-count-function-du)))
+
+(define-obsolete-variable-alias 'counsel--git-grep-count-func
+ 'counsel-git-grep-count-function "0.11.0")
+(define-obsolete-function-alias 'counsel--git-grep-count-func-default
+ 'counsel-git-grep-count-function-du "0.11.0")
;;;###autoload
(defun counsel-git-grep (&optional cmd initial-input)
@@ -1446,7 +1458,7 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
(default-directory (if proj
(car proj)
(counsel-locate-git-root))))
- (setq counsel--git-grep-count (funcall counsel--git-grep-count-func))
+ (setq counsel--git-grep-count (funcall counsel-git-grep-count-function))
(ivy-read "git grep: " collection-function
:initial-input initial-input
:matcher #'counsel-git-grep-matcher
- [elpa] master 82e6c54 067/399: counsel.el: Clean up compile make invocation, (continued)
- [elpa] master 82e6c54 067/399: counsel.el: Clean up compile make invocation, Oleh Krehel, 2019/07/20
- [elpa] master bb58a29 071/399: counsel.el (counsel-ag): Fix error in non-Git directory, Oleh Krehel, 2019/07/20
- [elpa] master f0d93cf 073/399: counsel.el (counsel-compile): counsel-compile-get-filtered-history, Oleh Krehel, 2019/07/20
- [elpa] master ce0c39e 076/399: counsel.el (counsel--git-root): Rename, Oleh Krehel, 2019/07/20
- [elpa] master a37d4e3 072/399: counsel.el (counsel-compile): fix breakage to subdir recursion, Oleh Krehel, 2019/07/20
- [elpa] master 86c904f 077/399: counsel.el (counsel-compile-root-functions): Change priority, Oleh Krehel, 2019/07/20
- [elpa] master c2788de 082/399: counsel.el (counsel--switch-buffer-update-fn): if to cond, Oleh Krehel, 2019/07/20
- [elpa] master 1439e8d 064/399: counsel.el: Simplify compile build dir collection, Oleh Krehel, 2019/07/20
- [elpa] master 7e8a362 068/399: counsel.el (counsel--get-make-targets): Clean up, Oleh Krehel, 2019/07/20
- [elpa] master d64b268 074/399: counsel.el (counsel-compile): counsel--get-build-subdirs, Oleh Krehel, 2019/07/20
- [elpa] master 6f0f32f 084/399: counsel.el (counsel-git-grep-count-function): Promote to defcustom,
Oleh Krehel <=
- [elpa] master 25336fd 075/399: counsel.el (counsel-compile): counsel-compile-local-builds, Oleh Krehel, 2019/07/20
- [elpa] master db905cc 088/399: counsel.el (counsel-compile-phony-pattern): Use plain regex, Oleh Krehel, 2019/07/20
- [elpa] master 4e07e6f 048/399: ivy.el (ivy-make-magic-action): Add docstring to the generated lambda, Oleh Krehel, 2019/07/20
- [elpa] master 8a40934 062/399: counsel.el: Clean up compile candidates list, Oleh Krehel, 2019/07/20
- [elpa] master 0c30e3f 063/399: counsel.el: Minor compile history cleanup, Oleh Krehel, 2019/07/20
- [elpa] master 114ae96 070/399: counsel.el: Find project root more flexibly, Oleh Krehel, 2019/07/20
- [elpa] master 5aa263c 079/399: counsel.el (counsel-compile-make-pattern): Fix regex, Oleh Krehel, 2019/07/20
- [elpa] master cc50da2 080/399: counsel.el (counsel-dired-jump-args): Fix -type d, Oleh Krehel, 2019/07/20
- [elpa] master a473519 086/399: Fix error in ivy-make-magic-action, Oleh Krehel, 2019/07/20
- [elpa] master 9ce9e4e 090/399: counsel.el (counsel-compile-phony-pattern): Fixup, Oleh Krehel, 2019/07/20