Enhance FFAP lookup backend

gf (+lookup/file) has been changed to:

+ Use the active selection instead of the filename-at-point when
  searching for a file (as requested in #4942).
+ Pre-fill the FFAP prompt with the thing at point if no obvious
  filepath can be guessed from it (via ffap-alist).
+ Offer to search the current project for the thing-at-point (if
  counsel-file-jump is available).
+ Fall back to a standard ffap prompt if all else fails.

I've also reversed te order of file lookup backends so that our FFAP
backend is treated as a never-failing last resort (also because the
bug-reference backend is known to fail gracefully, so we can trust it to
run first).

Closes #4942
This commit is contained in:
Henrik Lissner 2021-04-29 14:30:17 -04:00
parent 3a4024e790
commit 259cf83ef1
2 changed files with 22 additions and 15 deletions

View file

@ -99,8 +99,8 @@ argument: the identifier at point. See `set-lookup-handlers!' about adding to
this list.")
(defvar +lookup-file-functions
'(+lookup-ffap-backend-fn
+lookup-bug-reference-backend-fn)
'(+lookup-bug-reference-backend-fn
+lookup-ffap-backend-fn)
"Function for `+lookup/file' to try, before restoring to `find-file-at-point'.
Stops at the first function to return non-nil or change the current
window/point.