aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris2013-11-24 18:36:41 -0800
committerGlenn Morris2013-11-24 18:36:41 -0800
commit310294a38369db86610e5f5ab82860ce6451eada (patch)
tree6d763adeff9f745d4ff512ef9813495058540cc2 /src
parent6f20dd038e1ead5741a41001efc86cca63c0cf2e (diff)
downloademacs-310294a38369db86610e5f5ab82860ce6451eada.tar.gz
emacs-310294a38369db86610e5f5ab82860ce6451eada.zip
Further tweaks to the setting of Vload_path
This is giving me a headache... * src/lread.c (load_path_default): Change the sense of the argument. (init_lread): When EMACSLOADPATH is set, do not ignore changes from dump_path. When it is not, avoid checking dump_path twice.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/lread.c50
2 files changed, 35 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a0b0bb2b2a8..7f417ccca8a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12013-11-25 Glenn Morris <rgm@gnu.org> 12013-11-25 Glenn Morris <rgm@gnu.org>
2 2
3 * lread.c (load_path_default): Change the sense of the argument.
4 (init_lread): When EMACSLOADPATH is set, do not ignore changes
5 from dump_path. When it is not, avoid checking dump_path twice.
6
3 * lread.c (init_lread): Fix 2013-11-23 goof that was checking 7 * lread.c (init_lread): Fix 2013-11-23 goof that was checking
4 uninstalled dump_path against installed Vload_path. (Bug#15964) 8 uninstalled dump_path against installed Vload_path. (Bug#15964)
5 9
diff --git a/src/lread.c b/src/lread.c
index 1f49be6e361..dceeb43dff4 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4167,7 +4167,7 @@ static Lisp_Object dump_path;
4167 leim and site-lisp. 4167 leim and site-lisp.
4168*/ 4168*/
4169Lisp_Object 4169Lisp_Object
4170load_path_default (bool ignore_existing) 4170load_path_default (bool changed)
4171{ 4171{
4172 Lisp_Object lpath = Qnil; 4172 Lisp_Object lpath = Qnil;
4173 const char *normal; 4173 const char *normal;
@@ -4193,11 +4193,11 @@ load_path_default (bool ignore_existing)
4193 the source directory, instead of the path of the installed elisp 4193 the source directory, instead of the path of the installed elisp
4194 libraries. However, if it appears that Vload_path has already been 4194 libraries. However, if it appears that Vload_path has already been
4195 changed from the default that was saved before dumping, don't 4195 changed from the default that was saved before dumping, don't
4196 change it further. Changes can only be due to EMACSLOADPATH, or 4196 change it further. Changes can only be due to site-lisp
4197 site-lisp files that were processed during dumping. */ 4197 files that were processed during dumping. */
4198 if (initialized) 4198 if (initialized)
4199 { 4199 {
4200 if (!ignore_existing && NILP (Fequal (dump_path, Vload_path))) 4200 if (changed || NILP (Fequal (dump_path, Vload_path)))
4201 { 4201 {
4202 /* Do not make any changes. */ 4202 /* Do not make any changes. */
4203 return Vload_path; 4203 return Vload_path;
@@ -4332,19 +4332,27 @@ init_lread (void)
4332{ 4332{
4333 /* First, set Vload_path. */ 4333 /* First, set Vload_path. */
4334 4334
4335 /* NB: Do not change Vload_path before calling load_path_default,
4336 since it may check it against dump_path.
4337 (This behavior could be changed.) */
4338
4335 /* We explicitly ignore EMACSLOADPATH when dumping. */ 4339 /* We explicitly ignore EMACSLOADPATH when dumping. */
4336 if (NILP (Vpurify_flag) && egetenv ("EMACSLOADPATH")) 4340 if (NILP (Vpurify_flag) && egetenv ("EMACSLOADPATH"))
4337 { 4341 {
4338 Vload_path = decode_env_path ("EMACSLOADPATH", 0, 1); 4342 Lisp_Object elpath = decode_env_path ("EMACSLOADPATH", 0, 1);
4339 4343
4340 /* Check (non-nil) user-supplied elements. */ 4344 /* Check (non-nil) user-supplied elements. */
4341 load_path_check (Vload_path); 4345 load_path_check (elpath);
4342 4346
4343 /* Replace any nil elements from the environment with the default. */ 4347 /* If no nils in the environment variable, use as-is.
4344 if (!NILP (Fmemq (Qnil, Vload_path))) 4348 Otherwise, replace any nils with the default. */
4349 if (NILP (Fmemq (Qnil, elpath)))
4350 {
4351 Vload_path = elpath;
4352 }
4353 else
4345 { 4354 {
4346 Lisp_Object lpath = Vload_path; 4355 Lisp_Object elem, default_lpath = load_path_default (0);
4347 Lisp_Object elem, default_lpath = load_path_default (1);
4348 4356
4349 /* Check defaults, before adding site-lisp. */ 4357 /* Check defaults, before adding site-lisp. */
4350 load_path_check (default_lpath); 4358 load_path_check (default_lpath);
@@ -4361,11 +4369,11 @@ init_lread (void)
4361 Vload_path = Qnil; 4369 Vload_path = Qnil;
4362 4370
4363 /* Replace nils from EMACSLOADPATH by default. */ 4371 /* Replace nils from EMACSLOADPATH by default. */
4364 while (CONSP (lpath)) 4372 while (CONSP (elpath))
4365 { 4373 {
4366 Lisp_Object arg[2]; 4374 Lisp_Object arg[2];
4367 elem = XCAR (lpath); 4375 elem = XCAR (elpath);
4368 lpath = XCDR (lpath); 4376 elpath = XCDR (elpath);
4369 arg[0] = Vload_path; 4377 arg[0] = Vload_path;
4370 arg[1] = NILP (elem) ? default_lpath : Fcons (elem, Qnil); 4378 arg[1] = NILP (elem) ? default_lpath : Fcons (elem, Qnil);
4371 Vload_path = Fappend (2, arg); 4379 Vload_path = Fappend (2, arg);
@@ -4374,8 +4382,13 @@ init_lread (void)
4374 } 4382 }
4375 else /* Vpurify_flag || !EMACSLOADPATH */ 4383 else /* Vpurify_flag || !EMACSLOADPATH */
4376 { 4384 {
4377 Lisp_Object lpath = Vload_path; 4385#ifdef CANNOT_DUMP
4378 Vload_path = load_path_default (0); 4386 bool changed = 0;
4387#else
4388 bool changed = initialized && NILP (Fequal (dump_path, Vload_path));
4389#endif
4390
4391 Vload_path = load_path_default (changed);
4379 4392
4380 /* Check before adding site-lisp directories. 4393 /* Check before adding site-lisp directories.
4381 The install should have created them, but they are not 4394 The install should have created them, but they are not
@@ -4384,10 +4397,9 @@ init_lread (void)
4384 load_path_check (Vload_path); 4397 load_path_check (Vload_path);
4385 4398
4386 /* Add the site-lisp directories at the front, unless the 4399 /* Add the site-lisp directories at the front, unless the
4387 load-path has somehow already been changed (this can only be 4400 load-path has already been changed.
4388 from a site-load file during dumping?) from the dumped value. 4401 FIXME? Should we ignore changed here? */
4389 FIXME? Should we ignore any dump_path changes? */ 4402 if (initialized && !no_site_lisp && !changed)
4390 if (initialized && !no_site_lisp && !NILP (Fequal (dump_path, lpath)))
4391 { 4403 {
4392 Lisp_Object sitelisp; 4404 Lisp_Object sitelisp;
4393 sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0); 4405 sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);