within the variable `invocation-directory' or its parent. For example,
this is the case when running an uninstalled Emacs executable from its
build directory. */);
- Vinstallation_directory = Qnil;
+ if (!Vinstallation_directory)
+ Vinstallation_directory = Qnil;
DEFVAR_LISP ("system-messages-locale", Vsystem_messages_locale,
doc: /* System locale for messages. */);
{
Lisp_Object lpath = Qnil;
const char *normal;
+ bool initialized_or_cannot_dump;
#ifdef CANNOT_DUMP
-#ifdef HAVE_NS
- const char *loadpath = ns_load_path ();
-#endif
-
- normal = PATH_DUMPLOADSEARCH;
-#ifdef HAVE_NS
- lpath = decode_env_path (0, loadpath ? loadpath : normal, 0);
+ initialized_or_cannot_dump = true;
+ normal = PATH_LOADSEARCH;
#else
- lpath = decode_env_path (0, normal, 0);
-#endif
-
-#else /* !CANNOT_DUMP */
-
+ initialized_or_cannot_dump = initialized;
normal = NILP (Vpurify_flag) ? PATH_LOADSEARCH : PATH_DUMPLOADSEARCH;
+#endif
- if (initialized)
+ if (initialized_or_cannot_dump)
{
#ifdef HAVE_NS
const char *loadpath = ns_load_path ();
} /* if Vinstallation_directory */
}
- else /* !initialized */
+ else /* !initialized_or_cannot_dump */
{
/* NORMAL refers to PATH_DUMPLOADSEARCH, ie the lisp dir in the
source directory. We used to add ../lisp (ie the lisp dir in
for Makefile. */
lpath = decode_env_path (0, normal, 0);
}
-#endif /* !CANNOT_DUMP */
return lpath;
}
void
init_lread (void)
{
- /* First, set Vload_path. */
+ /* Set Vsource_directory before calling load_path_default. */
+ Vsource_directory
+ = Fexpand_file_name (build_string ("../"),
+ Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0)));
+
+ /* Set Vload_path. */
/* Ignore EMACSLOADPATH when dumping. */
#ifdef CANNOT_DUMP
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)));
DEFVAR_LISP ("preloaded-file-list", Vpreloaded_file_list,
doc: /* List of files that were preloaded (when dumping Emacs). */);