elisp - In Emacs Lisp, how to find where the symbol is defined -


when c-h f or c-h v, tells me in file symbol defined or autoloaded from. how can find same information programmatically?

some digging reveals

(find-lisp-object-file-name object type) 

should trick. example:

(find-lisp-object-file-name 'goto-line 'function) ;; => "/usr/local/cellar/emacs/24.3/share/emacs/24.3/lisp/simple.el" 

edit: how discovered information:

first did c-h k c-h f figure out c-h f bound to. result describe-function, let's c-h f describe-function see source that. noticed interactive wrapper around describe-function-1, jumped source that. there's lot of stuff in there, pertinent line is:

(file-name (find-lisp-object-file-name function def)) 

revealing find-lisp-object-file-name function used work internally.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -