aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2020-01-27 23:04:20 -0800
committerPaul Eggert2020-01-27 23:17:10 -0800
commita02b179242a55aba20158aa245e5643a04d07576 (patch)
tree60ea8c8bbba239d0c92d459d47b588b1b2a53571
parent688e92426bfa2c5f21bd2ab7a1361c8febf2ca90 (diff)
downloademacs-a02b179242a55aba20158aa245e5643a04d07576.tar.gz
emacs-a02b179242a55aba20158aa245e5643a04d07576.zip
Revert the --with-install-srcdir patch
Also, update description of debuginfo and sources to match Debian and Red Hat more accurately, and move this sad tale from INSTALL to etc/PROBLEMS which is a better home for it. * Makefile.in (emacs_srcdir, install-c-src): * configure.ac (emacs_srcdir, --with-install-srcdir): * src/epaths.in (PATH_EMACS_SOURCE): * src/lread.c (emacs-source-directory): Remove. All uses removed. * lisp/emacs-lisp/find-func.el (find-function-C-source): Do not worry about compressed C sources. * src/lread.c: Do not include <dosname.h>.
-rw-r--r--INSTALL37
-rw-r--r--Makefile.in31
-rw-r--r--configure.ac14
-rw-r--r--etc/NEWS10
-rw-r--r--etc/PROBLEMS77
-rw-r--r--lisp/emacs-lisp/find-func.el11
-rw-r--r--lisp/startup.el3
-rw-r--r--src/epaths.in4
-rw-r--r--src/lread.c10
9 files changed, 84 insertions, 113 deletions
diff --git a/INSTALL b/INSTALL
index 7a1b46872d4..f1ceb2c1bf8 100644
--- a/INSTALL
+++ b/INSTALL
@@ -215,43 +215,6 @@ eg 'emacs25'). On Red Hat-based systems, the corresponding command is
215'dnf builddep emacs' (on older systems, use 'yum-builddep' instead). 215'dnf builddep emacs' (on older systems, use 'yum-builddep' instead).
216 216
217 217
218DEBUGGING AN INSTALLED EMACS
219
220* Installed Emacs source code
221
222Emacs typically installs a compressed copy of much of its source code,
223to make it easy for users to read Emacs source code via commands like
224M-x describe-function (C-h f) to display the definition of a function.
225This compressed copy ordinarily includes both the Elisp source code
226that Emacs is mostly written in, as well as the C source code for the
227core Emacs executable.
228
229* GNU/Linux source and debug packages
230
231Many GNU/Linux systems provide separate packages containing the
232sources and debug symbols of Emacs. They can help you debug the
233installed Emacs on the C level. The procedures for installing these
234packages depend on the GNU/Linux system that you use.
235
236Emacs debugging symbols are distributed by a debug package if one
237exists for your system. On Debian-based systems, you can
238install a debug package of Emacs with a command like 'apt-get install
239emacs-dbg' (on older systems, replace 'emacs' with e.g. 'emacs25').
240On Red Hat-based systems, the corresponding command is 'dnf
241debuginfo-install emacs'; this may require adding the *-debuginfo
242repositories first, via 'dnf config-manager --set-enabled
243fedora-debuginfo updates-debuginfo'.
244
245Some systems also have an Emacs source package that is also helpful
246when debugging the installed Emacs. To unpack an Emacs source package
247into the current directory on Debian-based systems, you can use a
248command like 'apt-get source emacs' (on older systems, replace 'emacs'
249with e.g. 'emacs25'); you may first need to add the appropriate
250'source' URIs to your sources.list. On Red Hat-based systems,
251installing the debugging symbols automatically installs the
252corresponding source package in the appropriate location.
253
254
255DETAILED BUILDING AND INSTALLATION: 218DETAILED BUILDING AND INSTALLATION:
256 219
257(This is for a Unix or Unix-like system. For GNUstep and macOS, 220(This is for a Unix or Unix-like system. For GNUstep and macOS,
diff --git a/Makefile.in b/Makefile.in
index adefa98fd02..2c82c49fba5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -266,9 +266,6 @@ etcdir=@etcdir@
266# once. 266# once.
267archlibdir=@archlibdir@ 267archlibdir=@archlibdir@
268 268
269# Where to install Emacs C source code, or empty if it is not installed.
270emacs_srcdir=@emacs_srcdir@
271
272# Where to put the etc/DOC file. 269# Where to put the etc/DOC file.
273etcdocdir=@etcdocdir@ 270etcdocdir=@etcdocdir@
274 271
@@ -377,7 +374,6 @@ epaths-force:
377 -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \ 374 -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
378 -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \ 375 -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
379 -e 's;\(#.*PATH_GAME\).*$$;\1 $(PATH_GAME);' \ 376 -e 's;\(#.*PATH_GAME\).*$$;\1 $(PATH_GAME);' \
380 -e 's;\(#.*PATH_EMACS_SOURCE\).*$$;\1 "${emacs_srcdir}";' \
381 -e 's;\(#.*PATH_DOC\).*$$;\1 "${etcdocdir}";') && \ 377 -e 's;\(#.*PATH_DOC\).*$$;\1 "${etcdocdir}";') && \
382 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h 378 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
383 379
@@ -465,7 +461,7 @@ $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/m4/*.m4
465# ==================== Installation ==================== 461# ==================== Installation ====================
466 462
467.PHONY: install install-arch-dep install-arch-indep install-etcdoc install-info 463.PHONY: install install-arch-dep install-arch-indep install-etcdoc install-info
468.PHONY: install-man install-c-src install-etc install-strip install-$(NTDIR) 464.PHONY: install-man install-etc install-strip install-$(NTDIR)
469.PHONY: uninstall uninstall-$(NTDIR) 465.PHONY: uninstall uninstall-$(NTDIR)
470 466
471## If we let lib-src do its own installation, that means we 467## If we let lib-src do its own installation, that means we
@@ -572,8 +568,7 @@ set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
572## work correctly, and therefore no idea when tar can be replaced. 568## work correctly, and therefore no idea when tar can be replaced.
573## See also these comments from 2004 about cp -r working fine: 569## See also these comments from 2004 about cp -r working fine:
574## https://lists.gnu.org/r/autoconf-patches/2004-11/msg00005.html 570## https://lists.gnu.org/r/autoconf-patches/2004-11/msg00005.html
575install-arch-indep: lisp install-info install-man install-c-src \ 571install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
576 $(INSTALL_ARCH_INDEP_EXTRA)
577 umask 022 && $(MKDIR_P) "$(DESTDIR)$(includedir)" 572 umask 022 && $(MKDIR_P) "$(DESTDIR)$(includedir)"
578 $(INSTALL_DATA) src/emacs-module.h "$(DESTDIR)$(includedir)/emacs-module.h" 573 $(INSTALL_DATA) src/emacs-module.h "$(DESTDIR)$(includedir)/emacs-module.h"
579 -set ${COPYDESTS} ; \ 574 -set ${COPYDESTS} ; \
@@ -705,28 +700,6 @@ install-man:
705 ${GZIP_PROG} -9n "$(DESTDIR)${man1dir}/$${dest}" || true; \ 700 ${GZIP_PROG} -9n "$(DESTDIR)${man1dir}/$${dest}" || true; \
706 done 701 done
707 702
708install-c-src:
709ifneq (,$(emacs_srcdir))
710 -unset CDPATH; \
711 umask 022; $(MKDIR_P) "$(DESTDIR)$(emacs_srcdir)/src" && \
712 exp_sourcesrcdir=`cd "$(DESTDIR)$(emacs_srcdir)/src" && /bin/pwd` && \
713 [ "`cd $(srcdir)/src && /bin/pwd`" = "$$exp_sourcesrcdir" ] || { \
714 $(set_installuser); \
715 printf 'Copying compressed C sources to %s ...\n' \
716 "$(DESTDIR)$(emacs_srcdir)/src"; \
717 for file in `cd $(srcdir) && echo src/*.[cm]`; do \
718 installed_file="$(DESTDIR)$(emacs_srcdir)/$$file" && \
719 $(INSTALL_DATA) "$$file" "$$installed_file" && \
720 [ -z "$(GZIP_PROG)" ] || { \
721 rm -f "$$installed_file.gz" && \
722 $(GZIP_PROG) -9n "$$installed_file" && \
723 installed_file=$$installed_file.gz; \
724 } || exit; \
725 chown $$installuser "$$installed_file" || true; \
726 done; \
727 }
728endif
729
730## Install those items from etc/ that need to end up elsewhere. 703## Install those items from etc/ that need to end up elsewhere.
731 704
732## If you prefer, choose "emacs22" at installation time. 705## If you prefer, choose "emacs22" at installation time.
diff --git a/configure.ac b/configure.ac
index 4de83c6b261..27e44dacfb2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -194,7 +194,6 @@ locallisppath='${datadir}/emacs/${version}/site-lisp:'\
194lisppath='${locallisppath}:${standardlisppath}' 194lisppath='${locallisppath}:${standardlisppath}'
195etcdir='${datadir}/emacs/${version}/etc' 195etcdir='${datadir}/emacs/${version}/etc'
196archlibdir='${libexecdir}/emacs/${version}/${configuration}' 196archlibdir='${libexecdir}/emacs/${version}/${configuration}'
197emacs_srcdir='${datadir}/emacs/${version}'
198etcdocdir='${datadir}/emacs/${version}/etc' 197etcdocdir='${datadir}/emacs/${version}/etc'
199gamedir='${localstatedir}/games/emacs' 198gamedir='${localstatedir}/games/emacs'
200 199
@@ -541,15 +540,6 @@ elif test "${enableval}" != "yes"; then
541 locallisppath=${enableval} locallisppathset=yes 540 locallisppath=${enableval} locallisppathset=yes
542fi) 541fi)
543 542
544AC_ARG_ENABLE([install-srcdir],
545 [AS_HELP_STRING([--disable-install-srcdir],
546 [do not install low-level Emacs source code useful for debugging.])],
547 [case $enableval in
548 yes) ;;
549 no) emacs_srcdir=;;
550 *) AC_MSG_ERROR([invalid install-srcdir]);;
551 esac])
552
553AC_ARG_ENABLE(checking, 543AC_ARG_ENABLE(checking,
554[AS_HELP_STRING([--enable-checking@<:@=LIST@:>@], 544[AS_HELP_STRING([--enable-checking@<:@=LIST@:>@],
555 [enable expensive checks. With LIST, 545 [enable expensive checks. With LIST,
@@ -2058,9 +2048,6 @@ if test "${HAVE_NS}" = yes; then
2058 dnl This one isn't really used, only archlibdir is. 2048 dnl This one isn't really used, only archlibdir is.
2059 libexecdir="\${ns_appbindir}/libexec" 2049 libexecdir="\${ns_appbindir}/libexec"
2060 archlibdir="\${ns_appbindir}/libexec" 2050 archlibdir="\${ns_appbindir}/libexec"
2061 case $emacs_srcdir in
2062 ?*) emacs_srcdir="\${ns_appresdir}";;
2063 esac
2064 etcdocdir="\${ns_appresdir}/etc" 2051 etcdocdir="\${ns_appresdir}/etc"
2065 etcdir="\${ns_appresdir}/etc" 2052 etcdir="\${ns_appresdir}/etc"
2066 dnl FIXME maybe set datarootdir instead. 2053 dnl FIXME maybe set datarootdir instead.
@@ -5243,7 +5230,6 @@ AC_SUBST(lisppath)
5243AC_SUBST(x_default_search_path) 5230AC_SUBST(x_default_search_path)
5244AC_SUBST(etcdir) 5231AC_SUBST(etcdir)
5245AC_SUBST(archlibdir) 5232AC_SUBST(archlibdir)
5246AC_SUBST([emacs_srcdir])
5247AC_SUBST(etcdocdir) 5233AC_SUBST(etcdocdir)
5248AC_SUBST(bitmapdir) 5234AC_SUBST(bitmapdir)
5249AC_SUBST(gamedir) 5235AC_SUBST(gamedir)
diff --git a/etc/NEWS b/etc/NEWS
index 276b8f46e81..5395f2ccfb2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -58,12 +58,6 @@ shaping, so 'configure' now recommends that combination.
58** The ftx font backend driver has been removed. 58** The ftx font backend driver has been removed.
59It was declared obsolete in Emacs 27.1. 59It was declared obsolete in Emacs 27.1.
60 60
61---
62** Emacs now installs a copy of its C source code, used for debugging help.
63For example, pressing the first button in the *Help* buffer generated
64by 'C-h f car RET' now takes you to a copy of the C-language
65implementation of the function 'car'.
66
67 61
68* Startup Changes in Emacs 28.1 62* Startup Changes in Emacs 28.1
69 63
@@ -148,10 +142,6 @@ called when the function object is garbage-collected. Use
148** 'parse-time-string' can now parse ISO 8601 format strings, 142** 'parse-time-string' can now parse ISO 8601 format strings,
149such as "2020-01-15T16:12:21-08:00". 143such as "2020-01-15T16:12:21-08:00".
150 144
151** The new variable 'emacs-source-directory' gives the location of
152a copy of the Emacs source code, which is now typically installed as a
153set of compressed source-code files.
154
155 145
156* Changes in Emacs 28.1 on Non-Free Operating Systems 146* Changes in Emacs 28.1 on Non-Free Operating Systems
157 147
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 9e4a631c729..4ce738d9a54 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -318,6 +318,83 @@ element from LD_LIBRARY_PATH before starting emacs proper.
318Or you could recompile Emacs with an -Wl,-rpath option that 318Or you could recompile Emacs with an -Wl,-rpath option that
319gives the location of the correct libotf. 319gives the location of the correct libotf.
320 320
321* Problems when reading or debugging Emacs C code
322
323Because Emacs does not install a copy of its C source code, users
324normally cannot easily read that code via commands like 'M-x
325describe-function' (C-h f) that display the definition of a function.
326However, some GNU/Linux systems provide separate packages containing
327this source code which can get C-h f to work if you are willing to do
328some tinkering, and some systems also provide packages containing
329debug info, which when combined with the source can be used to debug
330Emacs at the C level.
331
332** Debian-based source and debuginfo
333
334On recent Debian-based systems, you can obtain and use a source
335package of Emacs as follows.
336
337*** Add the appropriate URI to /etc/apt/sources.list.
338
339To do this, become superuser and uncomment or add the appropriate
340'deb-src' line. Details depend on the distribution.
341
342*** Execute a command like 'apt-get source emacs'.
343
344On older systems, append the top-level version number, e.g., 'apt-get
345source emacs25'. The target directory for unpacking the source tree
346is the current directory.
347
348*** Set find-function-C-source-directory accordingly.
349
350Once you have installed the source package, for example at
351/home/myself/deb-src/emacs-26.3, add the following line to your
352startup file:
353
354 (setq find-function-C-source-directory
355 "/home/myself/deb-src/emacs-26.3/src/")
356
357The installation directory of the Emacs source package will contain
358the exact package name and version number of Emacs that is installed
359on your system. If a new Emacs package is installed, the source
360package must be reinstalled as well, and the setting in your startup
361file must be updated.
362
363*** Debian-based debuginfo
364
365You can also install a debug package of Emacs with a command like
366'apt-get install emacs-dbg' (on older systems, 'apt-get install
367emacs25-dbg'). You need to arrange for GDB to find where you
368installed the source code, e.g., by using GDB's 'directory' command.
369
370** Red Hat-based source and debuginfo
371
372On recent Red Hat-based systems, you can install source and debug info
373via superuser commands like the following:
374
375 # Add the *-debuginfo repositories (exact command depends on system).
376 dnf config-manager --set-enabled fedora-debuginfo updates-debuginfo'
377
378 # Install Emacs source and debug info.
379 dnf install emacs-debugsource
380
381To get describe-function and similar commands to work, you can then
382add something like the following to your startup file:
383
384 (setq find-function-C-source-directory
385 "/usr/src/debug/emacs-26.3-1.fc31.x86_64/src/")
386
387However, the exact directory name will depend on the system, and you
388will need to both upgrade source and debug info when your system
389upgrades or patches Emacs, and change your startup file accordingly.
390
391** Source and debuginfo for other systems
392
393If your system follows neither the Debian nor the Red Hat patterns,
394you can obtain the source and debuginfo by obtaining the source code
395of Emacs, building Emacs with the appropriate debug flags enabled, and
396running the just-built Emacs.
397
321* General runtime problems 398* General runtime problems
322 399
323** Lisp problems 400** Lisp problems
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index be53324f141..167ead3ce02 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -219,10 +219,8 @@ 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" emacs-source-directory))) 222 (let ((dir (expand-file-name "src" 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)))
226 "Directory where the C source files of Emacs can be found. 224 "Directory where the C source files of Emacs can be found.
227If nil, do not try to find the source code of functions and variables 225If nil, do not try to find the source code of functions and variables
228defined in C.") 226defined in C.")
@@ -247,10 +245,7 @@ TYPE should be nil to find a function, or `defvar' to find a variable."
247 (let ((dir (or find-function-C-source-directory 245 (let ((dir (or find-function-C-source-directory
248 (read-directory-name "Emacs C source dir: " nil nil t)))) 246 (read-directory-name "Emacs C source dir: " nil nil t))))
249 (setq file (expand-file-name file dir)) 247 (setq file (expand-file-name file dir))
250 (if (or (file-readable-p file) 248 (if (file-readable-p file)
251 (let ((file-gz (concat file ".gz")))
252 (and (file-readable-p file-gz)
253 (setq file file-gz))))
254 (if (null find-function-C-source-directory) 249 (if (null find-function-C-source-directory)
255 (setq find-function-C-source-directory dir)) 250 (setq find-function-C-source-directory dir))
256 (error "The C source file %s is not available" 251 (error "The C source file %s is not available"
diff --git a/lisp/startup.el b/lisp/startup.el
index 676fb35e000..1f545c66922 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -623,8 +623,7 @@ 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 emacs-source-directory 626 (dolist (filesym '(data-directory doc-directory exec-directory
627 exec-directory
628 installation-directory 627 installation-directory
629 invocation-directory invocation-name 628 invocation-directory invocation-name
630 source-directory 629 source-directory
diff --git a/src/epaths.in b/src/epaths.in
index 554fdd7228a..3cadd160ecf 100644
--- a/src/epaths.in
+++ b/src/epaths.in
@@ -73,9 +73,5 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
73/* Where Emacs should store game score files. */ 73/* Where Emacs should store game score files. */
74#define PATH_GAME "/usr/local/var/games/emacs" 74#define PATH_GAME "/usr/local/var/games/emacs"
75 75
76/* Where Emacs should look for its own installed source code,
77 or the empty string if the source code is not installed. */
78#define PATH_EMACS_SOURCE "/usr/local/share/emacs"
79
80/* Where Emacs should look for the application default file. */ 76/* Where Emacs should look for the application default file. */
81#define PATH_X_DEFAULTS "/usr/lib/X11/%L/%T/%N%C%S:/usr/lib/X11/%l/%T/%N%C%S:/usr/lib/X11/%T/%N%C%S:/usr/lib/X11/%L/%T/%N%S:/usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S" 77#define PATH_X_DEFAULTS "/usr/lib/X11/%L/%T/%N%C%S:/usr/lib/X11/%l/%T/%N%C%S:/usr/lib/X11/%T/%N%C%S:/usr/lib/X11/%L/%T/%N%S:/usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S"
diff --git a/src/lread.c b/src/lread.c
index 274491f0229..69dd73912bc 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -44,7 +44,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
44#include "blockinput.h" 44#include "blockinput.h"
45#include "pdumper.h" 45#include "pdumper.h"
46#include <c-ctype.h> 46#include <c-ctype.h>
47#include <dosname.h>
48#include <vla.h> 47#include <vla.h>
49 48
50#ifdef MSDOS 49#ifdef MSDOS
@@ -4993,18 +4992,11 @@ and is not meant for users to change. */);
4993 4992
4994 DEFVAR_LISP ("source-directory", Vsource_directory, 4993 DEFVAR_LISP ("source-directory", Vsource_directory,
4995 doc: /* Directory in which Emacs sources were found when Emacs was built. 4994 doc: /* Directory in which Emacs sources were found when Emacs was built.
4996You cannot count on them to still be there! Also see 4995You cannot count on them to still be there! */);
4997`emacs-source-directory'. */);
4998 Vsource_directory 4996 Vsource_directory
4999 = Fexpand_file_name (build_string ("../"), 4997 = Fexpand_file_name (build_string ("../"),
5000 Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0))); 4998 Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0)));
5001 4999
5002 DEFVAR_LISP ("emacs-source-directory", Vemacs_source_directory,
5003 doc: /* Directory where Emacs sources can be found. */);
5004 Vemacs_source_directory = (IS_ABSOLUTE_FILE_NAME (PATH_EMACS_SOURCE)
5005 ? build_string (PATH_EMACS_SOURCE)
5006 : Vsource_directory);
5007
5008 DEFVAR_LISP ("preloaded-file-list", Vpreloaded_file_list, 5000 DEFVAR_LISP ("preloaded-file-list", Vpreloaded_file_list,
5009 doc: /* List of files that were preloaded (when dumping Emacs). */); 5001 doc: /* List of files that were preloaded (when dumping Emacs). */);
5010 Vpreloaded_file_list = Qnil; 5002 Vpreloaded_file_list = Qnil;