Emacs: how to jump to function definition in .el file?

Emacs

Emacs Problem Overview


I tried to edit my init file. Is there any possible way to quickly jump into function definition of other .el file that has already loaded/required ?

I remember doing this once, but don't remember how...

Emacs Solutions


Solution 1 - Emacs

M-x find-function RET (function name) RET

I find that C-h C-f makes a good keybinding for find-function (given that C-h f is bound by default to describe-function)

(global-set-key (kbd "C-h C-f") 'find-function)

Solution 2 - Emacs

As of emacs-25.1, there's a new generic function xref-find-definitions. The xref built-in package provides a generic framework for navigating definitions in code. Probably, it'd take some time for every mode to adjust custom functions for this framework, but, at the very least, emacs-lisp-mode already ported.

Solution 3 - Emacs

etags [options] file1 file2 ... and then, from inside emacs, do M-. to visit the tag. To go the the next occurrence of the tag, do M-,.

Solution 4 - Emacs

find-function is the way to go. An alternative is to use C-h f, then click the file name in buffer *Help*.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTg.View Question on Stackoverflow
Solution 1 - EmacsphilsView Answer on Stackoverflow
Solution 2 - EmacsHi-AngelView Answer on Stackoverflow
Solution 3 - Emacsvpit3833View Answer on Stackoverflow
Solution 4 - EmacsDrewView Answer on Stackoverflow