Wilfred / elisp-def

Find Emacs Lisp definitions
63 stars 6 forks source link

Bugfix/elisp def c functions #11

Closed nbfalcon closed 3 years ago

nbfalcon commented 3 years ago

elisp-def now doesn't error and properly blinks and recenters when jumping to functions defined in C or C++ code.

nbfalcon commented 3 years ago

Also, can we make that function public? It could be useful as an :after advice within find-function, find-variable, ... because then they could be made to jump to the function directly.

Similar support for rust will be needed, too, but I don't think I can implement that (I don't have any rust plugins).

nbfalcon commented 3 years ago

Here is a tested doom defadvice! for what I've just proposed:

(defadvice! my/find-function-recenter (sym &rest _)
  :after #'find-function-do-it
  (require 'elisp-def)
  (elisp-def--show-occurrence sym))
nbfalcon commented 3 years ago

Rust doesn't seem to expose the position? At least find-function didn't work with it, so supporting it probably isn't needed. This PR is ready.

Wilfred commented 3 years ago

Looks good, thank you! :)