Commit f5ab9736 authored by Richard M. Stallman's avatar Richard M. Stallman

(init_cmdargs): Just check for etc and lib-src subdirs

when setting Vinstallation_directory.
parent 996e89cd
...@@ -210,57 +210,39 @@ init_cmdargs (argc, argv, skip_args) ...@@ -210,57 +210,39 @@ init_cmdargs (argc, argv, skip_args)
name = Fexpand_file_name (Vinvocation_name, dir); name = Fexpand_file_name (Vinvocation_name, dir);
while (1) while (1)
{ {
Lisp_Object tem, lisp_exists, lib_src_exists; Lisp_Object tem, lib_src_exists;
Lisp_Object etc_exists, info_exists; Lisp_Object etc_exists, info_exists;
/* See if dir contains subdirs for use by Emacs. */ /* See if dir contains subdirs for use by Emacs.
tem = Fexpand_file_name (build_string ("lisp"), dir); Check for the ones that would exist in a build directory,
lisp_exists = Ffile_exists_p (tem); not including lisp and info. */
if (!NILP (lisp_exists)) tem = Fexpand_file_name (build_string ("lib-src"), dir);
lib_src_exists = Ffile_exists_p (tem);
if (!NILP (lib_src_exists))
{ {
tem = Fexpand_file_name (build_string ("lib-src"), dir); tem = Fexpand_file_name (build_string ("etc"), dir);
lib_src_exists = Ffile_exists_p (tem); etc_exists = Ffile_exists_p (tem);
if (!NILP (lib_src_exists)) if (!NILP (etc_exists))
{ {
tem = Fexpand_file_name (build_string ("etc"), dir); Vinstallation_directory
etc_exists = Ffile_exists_p (tem); = Ffile_name_as_directory (dir);
if (!NILP (etc_exists)) break;
{
tem = Fexpand_file_name (build_string ("info"), dir);
info_exists = Ffile_exists_p (tem);
if (!NILP (info_exists))
{
Vinstallation_directory
= Ffile_name_as_directory (dir);
break;
}
}
} }
} }
/* See if dir's parent contains those subdirs. */ /* See if dir's parent contains those subdirs. */
tem = Fexpand_file_name (build_string ("../lisp"), dir); tem = Fexpand_file_name (build_string ("../lib-src"), dir);
lisp_exists = Ffile_exists_p (tem); lib_src_exists = Ffile_exists_p (tem);
if (!NILP (lisp_exists)) if (!NILP (lib_src_exists))
{ {
tem = Fexpand_file_name (build_string ("../lib-src"), dir); tem = Fexpand_file_name (build_string ("../etc"), dir);
lib_src_exists = Ffile_exists_p (tem); etc_exists = Ffile_exists_p (tem);
if (!NILP (lib_src_exists)) if (!NILP (etc_exists))
{ {
tem = Fexpand_file_name (build_string ("../etc"), dir); tem = Fexpand_file_name (build_string (".."), dir);
etc_exists = Ffile_exists_p (tem); Vinstallation_directory
if (!NILP (etc_exists)) = Ffile_name_as_directory (tem);
{ break;
tem = Fexpand_file_name (build_string ("../info"), dir);
info_exists = Ffile_exists_p (tem);
if (!NILP (info_exists))
{
tem = Fexpand_file_name (build_string (".."), dir);
Vinstallation_directory
= Ffile_name_as_directory (tem);
break;
}
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment