diff --git a/modules/lang/idris/config.el b/modules/lang/idris/config.el index 249fd2d08..408a3b0fe 100644 --- a/modules/lang/idris/config.el +++ b/modules/lang/idris/config.el @@ -4,8 +4,7 @@ (add-hook 'idris-mode-hook #'turn-on-idris-simple-indent) (set-repl-handler! 'idris-mode 'idris-pop-to-repl) (set-lookup-handlers! 'idris-mode - :documentation #'idris-docs-at-point - :file #'idris-load-file) + :documentation #'idris-docs-at-point) (map! :localleader :map idris-mode-map "r" #'idris-load-file diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index 897800e44..3ab052322 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -46,7 +46,9 @@ capture, the end position, and the output buffer.") (set-flyspell-predicate! '(markdown-mode gfm-mode) #'+markdown-flyspell-word-p) (set-lookup-handlers! '(markdown-mode gfm-mode) - :file #'markdown-follow-thing-at-point) + ;; `markdown-follow-thing-at-point' may open an external program or a + ;; buffer. No good way to tell, so pretend it's async. + :file '(markdown-follow-thing-at-point :async t)) (setq-hook! 'markdown-mode-hook fill-nobreak-predicate (cons #'markdown-code-block-at-point-p diff --git a/modules/tools/lookup/autoload/lookup.el b/modules/tools/lookup/autoload/lookup.el index 6501134f4..7b012e256 100644 --- a/modules/tools/lookup/autoload/lookup.el +++ b/modules/tools/lookup/autoload/lookup.el @@ -281,34 +281,16 @@ Otherwise, falls back on `find-file-at-point'." (if ffap-url-regexp "Find file or URL: " "Find file: ") (doom-thing-at-point-or-region)))))) (require 'ffap) - (cond ((not path) - (call-interactively #'find-file-at-point)) + (cond ((and path + buffer-file-name + (file-equal-p path buffer-file-name) + (user-error "Already here"))) - ((ffap-url-p path) - (find-file-at-point path)) + ((+lookup--jump-to :file path)) - ((not (+lookup--jump-to :file 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 (doom-glob fullpath)) - #'find-file) - ((ignore-errors (file-in-directory-p fullpath project-root)) - (lambda (dir) - (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)))))) + ((stringp path) (find-file-at-point path)) + + ((call-interactively #'find-file-at-point)))) ;;