summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-06-01 01:03:51 +0000
committerRichard M. Stallman <rms@gnu.org>1997-06-01 01:03:51 +0000
commit90d5bf2c61c9d0bf3478e02846c287bc81bfde0b (patch)
tree144fbae721f45f285cb0f2218692aac0fe3e94b5 /src
parent413533f7c7e7a4d7dad823ca6955a6931828b244 (diff)
downloademacs-90d5bf2c61c9d0bf3478e02846c287bc81bfde0b.tar.gz
(init_lread): Sometimes add to load-path
the lisp and site-lisp dirs under the source directory.
Diffstat (limited to 'src')
-rw-r--r--src/lread.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lread.c b/src/lread.c
index 147114743b6..12482552cd3 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2511,6 +2511,32 @@ init_lread ()
if (NILP (Fmember (tem, Vload_path)))
Vload_path = nconc2 (Vload_path, Fcons (tem, Qnil));
}
+
+ /* If Emacs was not built in the source directory,
+ and it is run from where it was built,
+ add to load-path
+ the lisp and site-lisp dirs under the source directory. */
+
+ if (NILP (Fequal (Vinstallation_directory, Vsource_directory)))
+ {
+ tem = Fexpand_file_name (build_string ("src/Makefile"),
+ Vinstallation_directory);
+ tem1 = Ffile_exists_p (tem);
+ if (!NILP (tem1))
+ {
+ tem = Fexpand_file_name (build_string ("lisp"),
+ Vsource_directory);
+
+ if (NILP (Fmember (tem, Vload_path)))
+ Vload_path = nconc2 (Vload_path, Fcons (tem, Qnil));
+
+ tem = Fexpand_file_name (build_string ("site-lisp"),
+ Vsource_directory);
+
+ if (NILP (Fmember (tem, Vload_path)))
+ Vload_path = nconc2 (Vload_path, Fcons (tem, Qnil));
+ }
+ }
}
}
}