branch: master
commit 0debbd10bf737240b9c59c534ade50fb9bc6d3f6
Author: James Nguyen <[email protected]>
Commit: James Nguyen <[email protected]>
Make counsel-async filter update time configurable
---
counsel.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/counsel.el b/counsel.el
index 383dd16..f8550f4 100644
--- a/counsel.el
+++ b/counsel.el
@@ -195,16 +195,21 @@ EVENT is a string describing the change."
(setq ivy--old-cands ivy--all-candidates)
(ivy--exhibit)))))
+(defcustom counsel-async-filter-update-time 500000
+ "The amount of time in microseconds to wait until updating
+`counsel--async-filter'."
+ :type 'integer
+ :group 'ivy)
+
(defun counsel--async-filter (process str)
"Receive from PROCESS the output STR.
Update the minibuffer with the amount of lines collected every
-0.5 seconds since the last update."
+`counsel-async-filter-update-time' microseconds since the last update."
(with-current-buffer (process-buffer process)
(insert str))
(let (size)
(when (time-less-p
- ;; 0.5s
- '(0 0 500000 0)
+ `(0 0 ,counsel-async-filter-update-time 0)
(time-since counsel--async-time))
(with-current-buffer (process-buffer process)
(goto-char (point-min))