Throughout the day I am constantly using C-h f
or C-h v
(describe-function
and describe-variable
) to look up documentation for functions and variables. More often than not, if I don't get all the information I need, I will click on the file link at the end of:
some-random-command is an interactive compiled Lisp function in `some-mode.el'.
and navigate to the source code. This works for installed packages, but doesn't seem to work for built-in ones. For example, at the top of the help page for the command describe-function
all I get is:
describe-function is an interactive compiled Lisp function.
with no link to the source code. Is there any way to quickly navigate to the source code of a built in package?
I know I can find source code in e.g., /usr/share/emacs/24.5/lisp
, and come up with any number of ways to access that directory quickly, but I am curious if there is a quick and easy way to navigate to a built-in function/variable definition in the source code. Thank you!
M-x find-function
;M-x find-variable
;M-x find-face
;M-x find-library
. I always use a full installation of Emacs so that I have access to everything, and just after building my own Emacs I copy over the C-source code and set its location so that I can find C-Source code definitions also. See the variablefind-function-C-source-directory
to set the location of the C-source code after you copy it over.M-x describe-function
: describe-function is an interactive autoloaded compiled Lisp function in ‘help-fns.el’. And from there I can click on (or press enter on)help-fns.el
and am then transported to the applicable section of the code. Perhaps you have multiple Emacs versions, and the one your using at the moment doesn't have all the source code installed?emacs -Q
(no init file), or if you can repro it with a recipe that starts withemacs -Q
(e.g. saying what libraries you load and how you load them etc.), then please consider filing a bug report:M-x report-emacs-bug
..el
files (treated as optional) from the.elc
files (mandatory), such that you need to install one or more additional packages to get them. If you obtained Emacs from your OS package manager, perhaps this explains it./usr/bin/emacs
and/usr/bin/emacsclient
, and I have a version nicely packaged in an OSX application folder ending in .app -- i.e.,/Applications/Emacs.app
(inside that Emacs.app, are the binaries and all the source-code files).