diff options
| author | Glenn Morris | 2012-01-10 19:56:25 -0500 |
|---|---|---|
| committer | Glenn Morris | 2012-01-10 19:56:25 -0500 |
| commit | ce316182baa016f42348a69da69cab3f319ad2fa (patch) | |
| tree | 7a8792c0a097afaa1594435075d2c2186d55f484 | |
| parent | 6732f839b112b3f60a2ac1d7705baba946211b61 (diff) | |
| download | emacs-ce316182baa016f42348a69da69cab3f319ad2fa.tar.gz emacs-ce316182baa016f42348a69da69cab3f319ad2fa.zip | |
init_lread fix for bug#10208.
* src/lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
from load-path also when installation-directory is nil.
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/lread.c | 137 |
2 files changed, 75 insertions, 67 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e359924e8f7..4c74a76e2aa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-01-11 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs | ||
| 4 | from load-path also when installation-directory is nil. (Bug#10208) | ||
| 5 | |||
| 1 | 2012-01-10 Glenn Morris <rgm@gnu.org> | 6 | 2012-01-10 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * emacs.c (syms_of_emacs) <installation-directory>: Doc fix. | 8 | * emacs.c (syms_of_emacs) <installation-directory>: Doc fix. |
diff --git a/src/lread.c b/src/lread.c index 218efd90b36..23cda8eed6d 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -4169,17 +4169,17 @@ init_lread (void) | |||
| 4169 | if (! NILP (Fequal (dump_path, Vload_path))) | 4169 | if (! NILP (Fequal (dump_path, Vload_path))) |
| 4170 | { | 4170 | { |
| 4171 | Vload_path = decode_env_path (0, normal); | 4171 | Vload_path = decode_env_path (0, normal); |
| 4172 | if (!NILP (Vinstallation_directory)) | 4172 | if (no_site_lisp || !NILP (Vinstallation_directory)) |
| 4173 | { | 4173 | { |
| 4174 | Lisp_Object tem, tem1, sitelisp; | 4174 | Lisp_Object tem, tem1, sitelisp; |
| 4175 | 4175 | ||
| 4176 | /* Remove "site-lisp" dirs from front of path temporarily | 4176 | /* Remove "site-lisp" dirs from front of path temporarily |
| 4177 | and store them in sitelisp, then conc them on at the | 4177 | and store them in sitelisp, then conc them on at the |
| 4178 | end so they're always first in path. | 4178 | end so they're always first in path. |
| 4179 | Note that this won't work if you used a | 4179 | Note that this won't work if you used a |
| 4180 | --enable-locallisppath element that does not happen | 4180 | --enable-locallisppath element that does not happen |
| 4181 | to contain "site-lisp" in its name. | 4181 | to contain "site-lisp" in its name. |
| 4182 | */ | 4182 | */ |
| 4183 | sitelisp = Qnil; | 4183 | sitelisp = Qnil; |
| 4184 | while (1) | 4184 | while (1) |
| 4185 | { | 4185 | { |
| @@ -4195,93 +4195,96 @@ init_lread (void) | |||
| 4195 | break; | 4195 | break; |
| 4196 | } | 4196 | } |
| 4197 | 4197 | ||
| 4198 | /* Add to the path the lisp subdir of the | 4198 | if (!NILP (Vinstallation_directory)) |
| 4199 | installation dir, if it exists. */ | ||
| 4200 | tem = Fexpand_file_name (build_string ("lisp"), | ||
| 4201 | Vinstallation_directory); | ||
| 4202 | tem1 = Ffile_exists_p (tem); | ||
| 4203 | if (!NILP (tem1)) | ||
| 4204 | { | 4199 | { |
| 4205 | if (NILP (Fmember (tem, Vload_path))) | 4200 | /* Add to the path the lisp subdir of the |
| 4206 | { | 4201 | installation dir, if it exists. */ |
| 4207 | turn_off_warning = 1; | 4202 | tem = Fexpand_file_name (build_string ("lisp"), |
| 4208 | Vload_path = Fcons (tem, Vload_path); | ||
| 4209 | } | ||
| 4210 | } | ||
| 4211 | else | ||
| 4212 | /* That dir doesn't exist, so add the build-time | ||
| 4213 | Lisp dirs instead. */ | ||
| 4214 | Vload_path = nconc2 (Vload_path, dump_path); | ||
| 4215 | |||
| 4216 | /* Add leim under the installation dir, if it exists. */ | ||
| 4217 | tem = Fexpand_file_name (build_string ("leim"), | ||
| 4218 | Vinstallation_directory); | ||
| 4219 | tem1 = Ffile_exists_p (tem); | ||
| 4220 | if (!NILP (tem1)) | ||
| 4221 | { | ||
| 4222 | if (NILP (Fmember (tem, Vload_path))) | ||
| 4223 | Vload_path = Fcons (tem, Vload_path); | ||
| 4224 | } | ||
| 4225 | |||
| 4226 | /* Add site-lisp under the installation dir, if it exists. */ | ||
| 4227 | if (!no_site_lisp) | ||
| 4228 | { | ||
| 4229 | tem = Fexpand_file_name (build_string ("site-lisp"), | ||
| 4230 | Vinstallation_directory); | 4203 | Vinstallation_directory); |
| 4231 | tem1 = Ffile_exists_p (tem); | 4204 | tem1 = Ffile_exists_p (tem); |
| 4232 | if (!NILP (tem1)) | 4205 | if (!NILP (tem1)) |
| 4233 | { | 4206 | { |
| 4234 | if (NILP (Fmember (tem, Vload_path))) | 4207 | if (NILP (Fmember (tem, Vload_path))) |
| 4235 | Vload_path = Fcons (tem, Vload_path); | 4208 | { |
| 4209 | turn_off_warning = 1; | ||
| 4210 | Vload_path = Fcons (tem, Vload_path); | ||
| 4211 | } | ||
| 4236 | } | 4212 | } |
| 4237 | } | 4213 | else |
| 4238 | 4214 | /* That dir doesn't exist, so add the build-time | |
| 4239 | /* If Emacs was not built in the source directory, | 4215 | Lisp dirs instead. */ |
| 4240 | and it is run from where it was built, add to load-path | 4216 | Vload_path = nconc2 (Vload_path, dump_path); |
| 4241 | the lisp, leim and site-lisp dirs under that directory. */ | ||
| 4242 | |||
| 4243 | if (NILP (Fequal (Vinstallation_directory, Vsource_directory))) | ||
| 4244 | { | ||
| 4245 | Lisp_Object tem2; | ||
| 4246 | 4217 | ||
| 4247 | tem = Fexpand_file_name (build_string ("src/Makefile"), | 4218 | /* Add leim under the installation dir, if it exists. */ |
| 4219 | tem = Fexpand_file_name (build_string ("leim"), | ||
| 4248 | Vinstallation_directory); | 4220 | Vinstallation_directory); |
| 4249 | tem1 = Ffile_exists_p (tem); | 4221 | tem1 = Ffile_exists_p (tem); |
| 4250 | 4222 | if (!NILP (tem1)) | |
| 4251 | /* Don't be fooled if they moved the entire source tree | ||
| 4252 | AFTER dumping Emacs. If the build directory is indeed | ||
| 4253 | different from the source dir, src/Makefile.in and | ||
| 4254 | src/Makefile will not be found together. */ | ||
| 4255 | tem = Fexpand_file_name (build_string ("src/Makefile.in"), | ||
| 4256 | Vinstallation_directory); | ||
| 4257 | tem2 = Ffile_exists_p (tem); | ||
| 4258 | if (!NILP (tem1) && NILP (tem2)) | ||
| 4259 | { | 4223 | { |
| 4260 | tem = Fexpand_file_name (build_string ("lisp"), | ||
| 4261 | Vsource_directory); | ||
| 4262 | |||
| 4263 | if (NILP (Fmember (tem, Vload_path))) | 4224 | if (NILP (Fmember (tem, Vload_path))) |
| 4264 | Vload_path = Fcons (tem, Vload_path); | 4225 | Vload_path = Fcons (tem, Vload_path); |
| 4226 | } | ||
| 4265 | 4227 | ||
| 4266 | tem = Fexpand_file_name (build_string ("leim"), | 4228 | /* Add site-lisp under the installation dir, if it exists. */ |
| 4267 | Vsource_directory); | 4229 | if (!no_site_lisp) |
| 4230 | { | ||
| 4231 | tem = Fexpand_file_name (build_string ("site-lisp"), | ||
| 4232 | Vinstallation_directory); | ||
| 4233 | tem1 = Ffile_exists_p (tem); | ||
| 4234 | if (!NILP (tem1)) | ||
| 4235 | { | ||
| 4236 | if (NILP (Fmember (tem, Vload_path))) | ||
| 4237 | Vload_path = Fcons (tem, Vload_path); | ||
| 4238 | } | ||
| 4239 | } | ||
| 4268 | 4240 | ||
| 4269 | if (NILP (Fmember (tem, Vload_path))) | 4241 | /* If Emacs was not built in the source directory, |
| 4270 | Vload_path = Fcons (tem, Vload_path); | 4242 | and it is run from where it was built, add to load-path |
| 4243 | the lisp, leim and site-lisp dirs under that directory. */ | ||
| 4271 | 4244 | ||
| 4272 | if (!no_site_lisp) | 4245 | if (NILP (Fequal (Vinstallation_directory, Vsource_directory))) |
| 4246 | { | ||
| 4247 | Lisp_Object tem2; | ||
| 4248 | |||
| 4249 | tem = Fexpand_file_name (build_string ("src/Makefile"), | ||
| 4250 | Vinstallation_directory); | ||
| 4251 | tem1 = Ffile_exists_p (tem); | ||
| 4252 | |||
| 4253 | /* Don't be fooled if they moved the entire source tree | ||
| 4254 | AFTER dumping Emacs. If the build directory is indeed | ||
| 4255 | different from the source dir, src/Makefile.in and | ||
| 4256 | src/Makefile will not be found together. */ | ||
| 4257 | tem = Fexpand_file_name (build_string ("src/Makefile.in"), | ||
| 4258 | Vinstallation_directory); | ||
| 4259 | tem2 = Ffile_exists_p (tem); | ||
| 4260 | if (!NILP (tem1) && NILP (tem2)) | ||
| 4273 | { | 4261 | { |
| 4274 | tem = Fexpand_file_name (build_string ("site-lisp"), | 4262 | tem = Fexpand_file_name (build_string ("lisp"), |
| 4275 | Vsource_directory); | 4263 | Vsource_directory); |
| 4276 | 4264 | ||
| 4277 | if (NILP (Fmember (tem, Vload_path))) | 4265 | if (NILP (Fmember (tem, Vload_path))) |
| 4278 | Vload_path = Fcons (tem, Vload_path); | 4266 | Vload_path = Fcons (tem, Vload_path); |
| 4267 | |||
| 4268 | tem = Fexpand_file_name (build_string ("leim"), | ||
| 4269 | Vsource_directory); | ||
| 4270 | |||
| 4271 | if (NILP (Fmember (tem, Vload_path))) | ||
| 4272 | Vload_path = Fcons (tem, Vload_path); | ||
| 4273 | |||
| 4274 | if (!no_site_lisp) | ||
| 4275 | { | ||
| 4276 | tem = Fexpand_file_name (build_string ("site-lisp"), | ||
| 4277 | Vsource_directory); | ||
| 4278 | |||
| 4279 | if (NILP (Fmember (tem, Vload_path))) | ||
| 4280 | Vload_path = Fcons (tem, Vload_path); | ||
| 4281 | } | ||
| 4279 | } | 4282 | } |
| 4280 | } | 4283 | } /* Vinstallation_directory != Vsource_directory */ |
| 4281 | } | 4284 | } /* if Vinstallation_directory */ |
| 4282 | if (!NILP (sitelisp) && !no_site_lisp) | 4285 | if (!NILP (sitelisp) && !no_site_lisp) |
| 4283 | Vload_path = nconc2 (Fnreverse (sitelisp), Vload_path); | 4286 | Vload_path = nconc2 (Fnreverse (sitelisp), Vload_path); |
| 4284 | } /* if Vinstallation_directory */ | 4287 | } /* if Vinstallation_directory || no_site_lisp */ |
| 4285 | } /* if dump_path == Vload_path */ | 4288 | } /* if dump_path == Vload_path */ |
| 4286 | } | 4289 | } |
| 4287 | else /* !initialized */ | 4290 | else /* !initialized */ |