1

How can I find function Fcopy_sequence in the Emacs C source code?

2 Answers 2

2

The function copy-sequence is written in C and is contained within the source code file fns.c. If the source code files are available, they should be in a directory that matches the variable find-function-C-source-directory (which can be adjusted as needed).

The decision whether to include source code files is generally made at the time Emacs is built from source, but they can be added in the desired location after Emacs is built and the above-mentioned variable can be adjusted accordingly.

See also the variable source-directory. Keep in mind, however, that the function find-function-C-source looks for source code files in the path set by the variable find-function-C-source-directory (rather than the variable source-directory).

3
  • I'm looking for the definition of C fuction Fcopy_sequence located in the main source code of emacs.
    – Quasar999
    Commented Apr 9, 2022 at 18:48
  • When a function DEFUN is written in C, there is a common DEFUN name such as copy-sequence and also an internal function name Fcopy_sequence. It looks like this: DEFUN ("copy-sequence", Fcopy_sequence, Scopy_sequence, 1, 1, 0, doc: /* Return a copy of a list ... */) (Lisp_Object arg) .... It is defined inside the file .../emacs/src/fns.c where emacs is the root repository.
    – lawlist
    Commented Apr 9, 2022 at 18:50
  • Here is a link to the Emacs 28 source code file fns.c beginning at line 695: git.savannah.gnu.org/cgit/emacs.git/tree/src/…
    – lawlist
    Commented Apr 9, 2022 at 18:56
0

In the root of the source tree, run make tags to build the various tags files.

Then in Emacs you can use M-x find-tag to locate Fcopy_sequence using the tags file in the src directory (where all of the C code lives).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.