Fix problems with CANNOT_DUMP and EMACSLOADPATH.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 16 Dec 2013 22:35:57 +0000 (14:35 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 16 Dec 2013 22:35:57 +0000 (14:35 -0800)
* leim/Makefile.in (RUN_EMACS):
* lisp/Makefile.in (emacs): Add lisp src to EMACSLOADPATH.
* lisp/loadup.el: Check for src/bootstrap-emacs only when Emacs can dump.
Expand dir too, in case it's relative.
* src/lread.c (init_lread): If CANNOT_DUMP, we can't be dumping.

leim/ChangeLog
leim/Makefile.in
lisp/ChangeLog
lisp/Makefile.in
lisp/loadup.el
src/ChangeLog
src/lread.c

index 31b9c37..fa1612a 100644 (file)
@@ -1,3 +1,8 @@
+2013-12-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix problems with CANNOT_DUMP and EMACSLOADPATH.
+       * Makefile.in (RUN_EMACS): Add lisp src to EMACSLOADPATH.
+
 2013-11-28  Glenn Morris  <rgm@gnu.org>
 
        * Makefile.in (${leimdir}/leim-list.el):
index 383c521..33d68b7 100644 (file)
@@ -34,8 +34,8 @@ leimdir = ${srcdir}/../lisp/leim
 EMACS = ../src/emacs
 
 # How to run Emacs.
-# Prevent any setting of EMACSLOADPATH in user environment causing problems.
-RUN_EMACS = EMACSLOADPATH= "${EMACS}" -batch --no-site-file --no-site-lisp
+RUN_EMACS = EMACSLOADPATH='$(srcdir)/../lisp' '$(EMACS)' \
+  -batch --no-site-file --no-site-lisp
 
 MKDIR_P = @MKDIR_P@
 
index 1fe7bd6..795aa80 100644 (file)
@@ -1,3 +1,10 @@
+2013-12-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix problems with CANNOT_DUMP and EMACSLOADPATH.
+       * Makefile.in (emacs): Add lisp src to EMACSLOADPATH.
+       * loadup.el: Check for src/bootstrap-emacs only when Emacs can dump.
+       Expand dir too, in case it's relative.
+
 2013-12-16  Juri Linkov  <juri@jurta.org>
 
        * desktop.el (desktop-auto-save-timeout): Change default to
index 0cc2283..2ac2f3e 100644 (file)
@@ -105,8 +105,7 @@ COMPILE_FIRST = \
        $(lisp)/emacs-lisp/autoload.elc
 
 # The actual Emacs command run in the targets below.
-# Prevent any setting of EMACSLOADPATH in user environment causing problems.
-emacs = EMACSLOADPATH= "$(EMACS)" $(EMACSOPT)
+emacs = EMACSLOADPATH='$(lisp)' '$(EMACS)' $(EMACSOPT)
 
 # Common command to find subdirectories
 setwins=for file in `find . -type d -print`; do \
index 520fe4e..c6a3e3f 100644 (file)
        ;; FIXME this is irritatingly fragile.
        (equal (nth 4 command-line-args) "unidata-gen.el")
        (equal (nth 7 command-line-args) "unidata-gen-files")
-       ;; In case CANNOT_DUMP.
-       (string-match "src/bootstrap-emacs" (nth 0 command-line-args)))
+       (if (fboundp 'dump-emacs)
+           (string-match "src/bootstrap-emacs" (nth 0 command-line-args))
+         t))
     (let ((dir (car load-path)))
       ;; We'll probably overflow the pure space.
       (setq purify-flag nil)
-      (setq load-path (list dir
+      (setq load-path (list (expand-file-name "." dir)
                            (expand-file-name "emacs-lisp" dir)
                            (expand-file-name "language" dir)
                            (expand-file-name "international" dir)
index e2ff15e..36378fd 100644 (file)
@@ -1,3 +1,8 @@
+2013-12-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix problems with CANNOT_DUMP and EMACSLOADPATH.
+       * lread.c (init_lread): If CANNOT_DUMP, we can't be dumping.
+
 2013-12-16  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (Fmove_point_visually): Fix subtle bugs in the fallback
index 89bce5e..2bada06 100644 (file)
@@ -4293,8 +4293,14 @@ init_lread (void)
 {
   /* First, set Vload_path.  */
 
-  /* We explicitly ignore EMACSLOADPATH when dumping.  */
-  if (NILP (Vpurify_flag) && egetenv ("EMACSLOADPATH"))
+  /* Ignore EMACSLOADPATH when dumping.  */
+#ifdef CANNOT_DUMP
+  bool use_loadpath = true;
+#else
+  bool use_loadpath = !NILP (Vpurify_flag);
+#endif
+
+  if (use_loadpath && egetenv ("EMACSLOADPATH"))
     {
       Vload_path = decode_env_path ("EMACSLOADPATH", 0, 1);