diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2018-05-24 12:25:49 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2018-05-24 12:25:49 +0200 |
commit | 1aca3e84501955b98b824c7ddd221e88f9f2563d (patch) | |
tree | 6259210b9a31a559ee0641cba4a994807d4b6c82 /helm-mode.el | |
parent | 57810ae636c6c68f1f55f16d1c7988dee2617cfa (diff) |
Always use a sync handler when COLLECTION is a function
in completing-read.
* helm-mode.el (helm--completing-read-default): Do it.
Diffstat (limited to 'helm-mode.el')
-rw-r--r-- | helm-mode.el | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/helm-mode.el b/helm-mode.el index e47d0d33..8e805a3a 100644 --- a/helm-mode.el +++ b/helm-mode.el @@ -843,13 +843,13 @@ See documentation of `completing-read' and `all-completions' for details." ;; Disable hack that could be used before `completing-read'. ;; i.e (push ?\t unread-command-events). unread-command-events - (handler - ;; Use sync handler when completing-read is used to complete - ;; filenames or dirnames, typically the worst usage is - ;; generally completing-read+read-file-name-internal like - ;; find-file-at-point does. - (if (and (functionp collection) - minibuffer-completing-file-name) + (default-handler + ;; Typically when COLLECTION is a function, we can assume + ;; the intention is completing dynamically according to + ;; input; If one want to use in-buffer handler for specific + ;; usage with a function as collection he can specify it in + ;; helm-completing-read-handlers-alist. + (if (functionp collection) #'helm-completing-read-sync-default-handler #'helm-completing-read-default-handler))) (when (eq def-com 'ido) (setq def-com 'ido-completing-read)) @@ -886,10 +886,10 @@ See documentation of `completing-read' and `all-completions' for details." ;; If we are here `helm-mode' is now disabled. def-com (apply def-com def-args)) - (;; Use by default a cands-in-buffer handler which - ;; should work everywhere, it is much faster. + (;; Use by default a in-buffer handler unless + ;; COLLECTION is a function. t - (funcall handler + (funcall default-handler prompt collection predicate require-match initial-input hist def inherit-input-method str-command buf-name))) |