Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embark-target-guess-file-at-point does not play nicely with thing-at-point-provider-alist #743

Open
9viz opened this issue Nov 26, 2024 · 0 comments

Comments

@9viz
Copy link

9viz commented Nov 26, 2024

Hi,

In transmission-files-mode (from transmission.el), I register a filename provider like below:

(defun vz/transmission-files-register-tap-provider ()
  (setq-local thing-at-point-provider-alist
	  (cons `(filename . ,#'transmission-files-file-at-point)
		thing-at-point-provider-alist)))

(add-hook 'transmission-files-mode-hook #'vz/transmission-files-register-tap-provider)

where if I have the point anywhere on a line such as

100% normal    yes    1.8GiB All.My.Friends.Hate.Me.2021.1080p.WEBRip.x264-RARBG.mp4

then embark-act does not pick the filename provided by thing-at-point-provider-alist. This can be confirmed by manually evaulating

(thing-at-point 'filename)

or

(thing-at-point 'existing-filename)

This seems to be because embark-target-guess-file-at-point calls bounds-of-thing-at-point which fails because there is no way to provide a bound here (bounds-of-thing-at-point-provider-alist is a thing from Emacs 30.1). Moreover, even if there was a bounds function, it would surely fail because of the consequent ffap-file-at-point which would return nil.

Is there a way to account for this deficiency other than writing a new target finding function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant