From 29e851da27236f9cd92461f20b9efbd106e79417 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 6 Aug 2019 19:42:05 -0400 Subject: [PATCH] Try counsel-file-jump before project-find-file-in The former is more reliable (and faster, with the fd/rg hack in the next commit). Also (hopefully) fixes the "cl-no-applicable-method: No applicable method: project-roots" error emitted when project-find-file-in fails to identify the target as a project root. --- core/autoload/projects.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/autoload/projects.el b/core/autoload/projects.el index 6f4f52d17..7e40ac058 100644 --- a/core/autoload/projects.el +++ b/core/autoload/projects.el @@ -110,14 +110,16 @@ If DIR is not a project, it will be indexed (but not cached)." (setq projectile-enable-caching nil)) (call-interactively ;; Intentionally avoid `helm-projectile-find-file', because it runs - ;; asynchronously, and thus doesn't see the lexical `default-directory' + ;; asynchronously, and thus doesn't see the lexical + ;; `default-directory' (if (doom-module-p :completion 'ivy) #'counsel-projectile-find-file #'projectile-find-file))) - ((fboundp 'project-find-file-in) ; emacs 26.1+ only - (project-find-file-in nil (list default-directory) nil)) ((fboundp 'counsel-file-jump) ; ivy only (call-interactively #'counsel-file-jump)) + ((and (fboundp 'project-find-file-in) ; emacs 26.1+ only + (project-current)) + (project-find-file-in nil (list default-directory) nil)) ((fboundp 'helm-find-files) (call-interactively #'helm-find-files)) ((call-interactively #'find-file)))))