diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2018-08-01 14:40:16 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2018-08-01 14:40:16 +0200 |
commit | 5d63d31af2aa2c31972ed57fc04e66f2fcd7d9d2 (patch) | |
tree | e8587ae6709f5d9a119dde018fb3866252bdb65c /helm-dabbrev.el | |
parent | de20f620cc6db96be09dea8bf104146fc9bb6380 (diff) |
Compute cycle candidates first
* helm-dabbrev.el (helm-dabbrev): Do it.
Diffstat (limited to 'helm-dabbrev.el')
-rw-r--r-- | helm-dabbrev.el | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/helm-dabbrev.el b/helm-dabbrev.el index c8b399af..78a5f409 100644 --- a/helm-dabbrev.el +++ b/helm-dabbrev.el @@ -269,9 +269,20 @@ removed." ;; at startup. (unless (or cycling-disabled-p (helm-dabbrev-info-p helm-dabbrev--data)) + (setq helm-dabbrev--data + (make-helm-dabbrev-info + :dabbrev dabbrev + :limits limits + :iterator + (helm-iter-list + (cl-loop for i in (helm-dabbrev--get-candidates + dabbrev helm-dabbrev-cycle-threshold) + when (string-match-p + (concat "^" (regexp-quote dabbrev)) i) + collect i)))) ;; FIXME: For some reason the thread is blocking after the first ;; insertion and we have to wait the function building cache - ;; finish before insertion of second candidate, why? Is is an + ;; finish before insertion of second candidate, why? Is it an ;; emacs bug? This is reproductible when the limit is high and ;; helm is collecting a huge list of candidates. (if (fboundp 'make-thread) @@ -281,18 +292,7 @@ removed." (setq helm-dabbrev--cache (helm-dabbrev--get-candidates dabbrev))))) (setq helm-dabbrev--cache - (helm-dabbrev--get-candidates dabbrev))) - (setq helm-dabbrev--data - (make-helm-dabbrev-info - :dabbrev dabbrev - :limits limits - :iterator - (helm-iter-list - (cl-loop for i in (helm-dabbrev--get-candidates - dabbrev helm-dabbrev-cycle-threshold) - when (string-match-p - (concat "^" (regexp-quote dabbrev)) i) - collect i))))) + (helm-dabbrev--get-candidates dabbrev)))) (let ((iter (and (helm-dabbrev-info-p helm-dabbrev--data) (helm-dabbrev-info-iterator helm-dabbrev--data))) deactivate-mark) |