diff options
| author | Paul Eggert | 2020-01-24 16:41:38 -0800 |
|---|---|---|
| committer | Paul Eggert | 2020-01-24 16:46:42 -0800 |
| commit | f42d57c7dbd571b449270c8899a67e537561c2b2 (patch) | |
| tree | 3750aa093fb8ac135c20a247e8d82c49b55bd8a4 /lisp | |
| parent | 0c6c8aa002d321db61afdd14c70744f7bc27f268 (diff) | |
| download | emacs-f42d57c7dbd571b449270c8899a67e537561c2b2.tar.gz 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')
| -rw-r--r-- | lisp/emacs-lisp/find-func.el | 11 | ||||
| -rw-r--r-- | lisp/startup.el | 3 |
2 files changed, 10 insertions, 4 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)." | |||
| 219 | (locate-file basename (list dir) (find-library-suffixes))))))) | 219 | (locate-file basename (list dir) (find-library-suffixes))))))) |
| 220 | 220 | ||
| 221 | (defvar find-function-C-source-directory | 221 | (defvar find-function-C-source-directory |
| 222 | (let ((dir (expand-file-name "src" source-directory))) | 222 | (let ((dir (expand-file-name "src" emacs-source-directory))) |
| 223 | (if (file-accessible-directory-p dir) dir)) | 223 | (if (file-accessible-directory-p dir) dir |
| 224 | (setq dir (expand-file-name "src" source-directory)) | ||
| 225 | (if (file-accessible-directory-p dir) dir))) | ||
| 224 | "Directory where the C source files of Emacs can be found. | 226 | "Directory where the C source files of Emacs can be found. |
| 225 | If nil, do not try to find the source code of functions and variables | 227 | If nil, do not try to find the source code of functions and variables |
| 226 | defined in C.") | 228 | defined in C.") |
| @@ -245,7 +247,10 @@ TYPE should be nil to find a function, or `defvar' to find a variable." | |||
| 245 | (let ((dir (or find-function-C-source-directory | 247 | (let ((dir (or find-function-C-source-directory |
| 246 | (read-directory-name "Emacs C source dir: " nil nil t)))) | 248 | (read-directory-name "Emacs C source dir: " nil nil t)))) |
| 247 | (setq file (expand-file-name file dir)) | 249 | (setq file (expand-file-name file dir)) |
| 248 | (if (file-readable-p file) | 250 | (if (or (file-readable-p file) |
| 251 | (let ((file-gz (concat file ".gz"))) | ||
| 252 | (and (file-readable-p file-gz) | ||
| 253 | (setq file file-gz)))) | ||
| 249 | (if (null find-function-C-source-directory) | 254 | (if (null find-function-C-source-directory) |
| 250 | (setq find-function-C-source-directory dir)) | 255 | (setq find-function-C-source-directory dir)) |
| 251 | (error "The C source file %s is not available" | 256 | (error "The C source file %s is not available" |
diff --git a/lisp/startup.el b/lisp/startup.el index 1f545c66922..676fb35e000 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -623,7 +623,8 @@ It is the default value of the variable `top-level'." | |||
| 623 | (set pathsym (mapcar (lambda (dir) | 623 | (set pathsym (mapcar (lambda (dir) |
| 624 | (decode-coding-string dir coding t)) | 624 | (decode-coding-string dir coding t)) |
| 625 | path))))) | 625 | path))))) |
| 626 | (dolist (filesym '(data-directory doc-directory exec-directory | 626 | (dolist (filesym '(data-directory doc-directory emacs-source-directory |
| 627 | exec-directory | ||
| 627 | installation-directory | 628 | installation-directory |
| 628 | invocation-directory invocation-name | 629 | invocation-directory invocation-name |
| 629 | source-directory | 630 | source-directory |