From f42d57c7dbd571b449270c8899a67e537561c2b2 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 24 Jan 2020 16:41:38 -0800 Subject: Install C source code for C-h f etc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this change, on typical GNU/Linux distributions like Debian, the first button of ‘C-h f car RET’ does not work because the source code for ‘car’ is not installed (Bug#37527). Fix this by installing the (compressed) C source code alongside the (compressed) Lisp source code that is already installed. This adds about 3 MB (about 2%) to the size of the installed files on my platform. * Makefile.in (emacs_srcdir): New macro. (epaths-force): Substitute PATH_EMACS_SOURCE. (install-c-src): New rule, that installs a copy of the C source code if emacs_srcdir says to. (install-arch-indep): Depend on it. * configure.ac (emacs_srcdir): New var. Add support for --disable-install-srcdir. * lisp/emacs-lisp/find-func.el (find-function-C-source-directory): Look in emacs-source-directory first. (find-function-C-source): Also look for gzipped source files. * lisp/startup.el (normal-top-level): Also recode emacs-source-directory. * src/epaths.in (PATH_EMACS_SOURCE): New macro. * src/lread.c: Include dosname.h, for IS_ABSOLUTE_FILE_NAME. (syms_of_lread): New var emacs-source-directory. --- INSTALL | 65 +++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 33 insertions(+), 32 deletions(-) (limited to 'INSTALL') diff --git a/INSTALL b/INSTALL index 2d257f9ce68..cb12e4a17aa 100644 --- a/INSTALL +++ b/INSTALL @@ -214,41 +214,42 @@ like 'apt-get build-dep emacs' (on older systems, replace 'emacs' with eg 'emacs25'). On Red Hat-based systems, the corresponding command is 'dnf builddep emacs' (on older systems, use 'yum-builddep' instead). + +DEBUGGING AN INSTALLED EMACS + +* Installed Emacs source code + +Emacs installs a compressed copy of much of its source code, to make +it easy for users to read the source code of Emacs via commands like +M-x describe-function (C-h f) to display the definition of a function. +This compressed copy ordinarily includes both the Elisp source code +that Emacs is mostly written in, as well as the C source code for the +core Emacs executable. + * GNU/Linux source and debug packages Many GNU/Linux systems provide separate packages containing the -sources and debug symbols of Emacs. They are useful if you want to -check the source code of Emacs primitive functions or debug Emacs on -the C level. - -The names of the packages that you need vary according to the -GNU/Linux distribution that you use. On Debian-based systems, you can -install a source package of Emacs with a command like 'apt-get source -emacs' (on older systems, replace 'emacs' with eg 'emacs25'). The -target directory for unpacking the source tree is the current -directory. On Red Hat-based systems, the corresponding command is -'dnf install emacs-debugsource', with target directory /usr/src/debug -(this requires to add the *-debuginfo repositories first, via 'dnf -config-manager --set-enabled fedora-debuginfo updates-debuginfo'). - -Once you have installed the source package, for example at -/path/to/emacs-26.1, add the following line to your startup file: - - (setq find-function-C-source-directory - "/path/to/emacs-26.1/src") - -The installation directory of the Emacs source package will contain -the exact package name and version number Emacs is installed on your -system. If a new Emacs package is installed, the source package must -be reinstalled as well, and the setting in your startup file must be -updated. - -Emacs debugging symbols are distributed by a debug package. It does -not exist for every released Emacs package, this depends on the -distribution. On Debian-based systems, you can install a debug -package of Emacs with a command like 'apt-get install emacs-dbg' (on -older systems, replace 'emacs' with eg 'emacs25'). On Red Hat-based -systems, the corresponding command is 'dnf debuginfo-install emacs'. +sources and debug symbols of Emacs. They can help you debug the +installed Emacs on the C level. The procedures for installing these +packages depend on the GNU/Linux system that you use. + +Emacs debugging symbols are distributed by a debug package if one +exists for your system. On Debian-based systems, you can +install a debug package of Emacs with a command like 'apt-get install +emacs-dbg' (on older systems, replace 'emacs' with e.g. 'emacs25'). +On Red Hat-based systems, the corresponding command is 'dnf +debuginfo-install emacs'; this may require adding the *-debuginfo +repositories first, via 'dnf config-manager --set-enabled +fedora-debuginfo updates-debuginfo'. + +Some systems also have an Emacs source package that is also helpful +when debugging the installed Emacs. To unpack an Emacs source package +into the current directory on Debian-based systems, you can use a +command like 'apt-get source emacs' (on older systems, replace 'emacs' +with e.g. 'emacs25'); you may first need to add the appropriate +'source' URIs to your sources.list. On Red Hat-based systems, +installing the debugging symbols automatically installs the +corresponding source package in the appropriate location. DETAILED BUILDING AND INSTALLATION: -- cgit v1.2.1