minad / consult

:mag: consult.el - Consulting completing-read
GNU General Public License v3.0
1.12k stars 98 forks source link

consult hangs with find-file at emacs startup #935

Closed rickalex21 closed 3 months ago

rickalex21 commented 3 months ago

Hello,

Was something changed recently that affects this code? It takes a while to bring up the results at startup. After it hangs for a while then I'm able to search normally. This was not a problem a few weeks ago.

(defun my/fd (&optional dir flags initial)
    (interactive "P")
    (setq my/fd-flags (if flags (append (split-string my/fd-default)(split-string flags))(split-string my/fd-default)))
    (let* ((prompt-dir (consult--directory-prompt "Fd" dir))
          (default-directory (car (last prompt-dir))))
      (find-file (consult--find (car prompt-dir) #'consult--fd-builder initial))))

I usually call it like this:

(defun my/fd-org () "org/"       (interactive)(my/fd (concat org-directory) "--extension=org --extension=md --extension=tex" ))

Thanks