Remove witout-project-cache!, rename project-file-exists-p

To doom-project-file-exists-p, which is now a function.
This commit is contained in:
Henrik Lissner 2019-07-21 15:47:14 +02:00
parent 7058facf9d
commit 832b7e9294
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 14 additions and 23 deletions

View file

@ -297,22 +297,24 @@ Otherwise, falls back on `find-file-at-point'."
(find-file-at-point path))
((not (+lookup--jump-to :file path))
(let ((fullpath (expand-file-name path)))
(let ((fullpath (doom-path path)))
(when (and buffer-file-name (file-equal-p fullpath buffer-file-name))
(user-error "Already here"))
(let* ((insert-default-directory t)
(project-root (doom-project-root))
(ffap-file-finder
(cond ((not (file-directory-p fullpath))
(cond ((not (doom-glob fullpath))
#'find-file)
((ignore-errors (file-in-directory-p fullpath project-root))
(lambda (dir)
(let ((default-directory dir))
(without-project-cache!
(let ((file (projectile-completing-read "Find file: "
(projectile-current-project-files)
:initial-input path)))
(find-file (expand-file-name file (doom-project-root)))
(run-hooks 'projectile-find-file-hook))))))
(let* ((default-directory dir)
projectile-project-name
projectile-project-root
(projectile-project-root-cache (make-hash-table :test 'equal))
(file (projectile-completing-read "Find file: "
(projectile-current-project-files)
:initial-input path)))
(find-file (expand-file-name file (doom-project-root)))
(run-hooks 'projectile-find-file-hook))))
(#'doom-project-browse))))
(find-file-at-point path))))))