I want to read Emacs source code while searching for functions in Emacs.

Asked 1 years ago, Updated 1 years ago, 105 views

I wanted to read the Emacs source code, so I could access the elisp source code that defines functions in C-hk and C-hf, but
When I tried to access a more core part of the source file written in C language (searching C-hf and trying to jump to a place linked to C source code), it became like "The C source window.c is not available" and I couldn't jump.

Where is the source file of C implementing Emacs stored?

I installed it on Mac OS X using Homebrew.
The elisp file is located in the following directory:
/usr/local/Cellar/emacs-mac/emacs-25.1-z-mac-6.1/share/emacs/25.1/lisp/

emacs elisp

2022-09-30 21:19

3 Answers

From the help screen, you can link C to a function by setting the find-function-C-source-directory variable to the directory where the emacs were compiled.

In the case of Homebrew, the source code may be present in ~/Library/Caches/Homebrew/emacs-* (where * is the version number).If so, add (assuming the emacs version is 24.3) (setq find-function-C-source-directory"~/Library/Caches/Homebrew/emacs-24.3/src") to ~/.emacs.


2022-09-30 21:19

When searching for C language source code (header) in emacs, the tag table was created with the command etag and the function was tracked with M-. and M-x find-tag.

https://www.gnu.org/software/emacs/manual/html_node/emacs/Tags-Tables.html#Tags-Tables


2022-09-30 21:19

It's mirrored by GitHub, so why don't you look over there first?
https://github.com/emacs-mirror/emacs/blob/master/src/window.c


2022-09-30 21:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.