summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-01-24 16:41:38 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2020-01-24 16:46:42 -0800
commitf42d57c7dbd571b449270c8899a67e537561c2b2 (patch)
tree3750aa093fb8ac135c20a247e8d82c49b55bd8a4 /lisp/emacs-lisp
parent0c6c8aa002d321db61afdd14c70744f7bc27f268 (diff)
downloademacs-f42d57c7dbd571b449270c8899a67e537561c2b2.tar.gz
emacs-f42d57c7dbd571b449270c8899a67e537561c2b2.tar.bz2
emacs-f42d57c7dbd571b449270c8899a67e537561c2b2.zip
Install C source code for C-h f etc.
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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/find-func.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 167ead3ce02..be53324f141 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -219,8 +219,10 @@ LIBRARY should be a string (the name of the library)."
(locate-file basename (list dir) (find-library-suffixes)))))))
(defvar find-function-C-source-directory
- (let ((dir (expand-file-name "src" source-directory)))
- (if (file-accessible-directory-p dir) dir))
+ (let ((dir (expand-file-name "src" emacs-source-directory)))
+ (if (file-accessible-directory-p dir) dir
+ (setq dir (expand-file-name "src" source-directory))
+ (if (file-accessible-directory-p dir) dir)))
"Directory where the C source files of Emacs can be found.
If nil, do not try to find the source code of functions and variables
defined in C.")
@@ -245,7 +247,10 @@ TYPE should be nil to find a function, or `defvar' to find a variable."
(let ((dir (or find-function-C-source-directory
(read-directory-name "Emacs C source dir: " nil nil t))))
(setq file (expand-file-name file dir))
- (if (file-readable-p file)
+ (if (or (file-readable-p file)
+ (let ((file-gz (concat file ".gz")))
+ (and (file-readable-p file-gz)
+ (setq file file-gz))))
(if (null find-function-C-source-directory)
(setq find-function-C-source-directory dir))
(error "The C source file %s is not available"