Subject: Re: bug#37527: [PATCH] Install C source code for for debugging help

From: Eli Zaretskii <[email-masked]>
Date: Sat, 25 Jan 2020 09:58:42 +0200

> Cc: [email-masked], [email-masked], [email-masked],
>  [email-masked]
> From: Paul Eggert <[email-masked]>
> Date: Fri, 24 Jan 2020 16:47:49 -0800
> 
> OK, I did it that way by installing the attached patch instead; the new 
> separate variable is 'emacs-source-directory'.

Thanks, but the name of this variable gives no clue about the sources
being installed as part of "make install", and neither does its
documentation.  How about emacs-installed-source-directory?

> +DEBUGGING AN INSTALLED EMACS
> +
> +* Installed Emacs source code
> +
> +Emacs installs a compressed copy of much of its source code, to make

"optionally installs", right?  This is an opt-in feature, right?

> @@ -374,6 +377,7 @@ epaths-force:
>  	  -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";'		\
>  	  -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
>  	  -e 's;\(#.*PATH_GAME\).*$$;\1 $(PATH_GAME);'			\
> +	  -e 's;\(#.*PATH_EMACS_SOURCE\).*$$;\1 "${emacs_srcdir}";'	\
>  	  -e 's;\(#.*PATH_DOC\).*$$;\1 "${etcdocdir}";') &&		\
>  	${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h

The epath-force-w32 part needs a similar change.

> +AC_ARG_ENABLE([install-srcdir],
> +  [AS_HELP_STRING([--disable-install-srcdir],
> +     [do not install low-level Emacs source code useful for debugging.])],

I don't think we agreed to make this on by default, did we?

> +** The new variable 'emacs-source-directory' gives the Emacs source
> +code location.

This should explain that this is a copy of the sources, different
from the original source tree where Emacs was built.

>  (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)))

This is backwards, IMO: it should first try the original source tree,
and only next the installed sources.