emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Correct Path to Emacs C Sources after Installation


From: Alexander Shukaev
Subject: Correct Path to Emacs C Sources after Installation
Date: Tue, 4 Nov 2014 22:43:08 +0100

Hello everyone,

I've raised a discussion about the "source-directory" variable on another mailing list and we've come to some intermediate conclusion which might be satisfying for everyone, so I think it is time to consider implementation details.

Motivation is as follows. Currently, there is the following code:

  DEFVAR_LISP ("source-directory", Vsource_directory,
      doc: /* Directory in which Emacs sources were found when Emacs was built.
You cannot count on them to still be there!  */);
  Vsource_directory
    = Fexpand_file_name (build_string ("../"),
Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0)));

and "Vsource_directory", i.e. this is the default. Notice that "PATH_DUMPLOADSEARCH" is a hard coded path to the root directory containing Emacs sources during build. It means that in overwhelming number of cases this directory already does not exist when Emacs is installed and used. Why? Consider the following cases:
  1. Emacs sources were relocated/deleted after build;
  2. Emacs is being built on some build machine and then distributed as a prebuilt package to end users (the most common and convenient way to obtain Emacs for users today on all platforms), i.e. that path does not even exist on users' machines.
To summarize:

You cannot count on them to still be there!

I find this default annoying and I believe it can be improved. Here is the solution that I see.

For the installation phase we add the *optional* "--install-sources" flag which would trigger copying of C sources under "${etcdir}/../src" (which in fact is "<datadir>/emacs/VERSION/src"). We also apply the attached patch.

Looking forward to your feedback. Thanks in advance.

Kind regards,
Alexander

Attachment: lread.c.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]