From 8fb8c4f3735ac3b1b61bd3472a7ba2ad35d1dad5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 16 Dec 2013 14:35:57 -0800 Subject: [PATCH] Fix problems with CANNOT_DUMP and EMACSLOADPATH. * 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 | 5 +++++ leim/Makefile.in | 4 ++-- lisp/ChangeLog | 7 +++++++ lisp/Makefile.in | 3 +-- lisp/loadup.el | 7 ++++--- src/ChangeLog | 5 +++++ src/lread.c | 10 ++++++++-- 7 files changed, 32 insertions(+), 9 deletions(-) diff --git a/leim/ChangeLog b/leim/ChangeLog index 31b9c37690..fa1612ab03 100644 --- a/leim/ChangeLog +++ b/leim/ChangeLog @@ -1,3 +1,8 @@ +2013-12-16 Paul Eggert + + Fix problems with CANNOT_DUMP and EMACSLOADPATH. + * Makefile.in (RUN_EMACS): Add lisp src to EMACSLOADPATH. + 2013-11-28 Glenn Morris * Makefile.in (${leimdir}/leim-list.el): diff --git a/leim/Makefile.in b/leim/Makefile.in index 383c521504..33d68b797d 100644 --- a/leim/Makefile.in +++ b/leim/Makefile.in @@ -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@ diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1fe7bd62b0..795aa8026b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-12-16 Paul Eggert + + 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 * desktop.el (desktop-auto-save-timeout): Change default to diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 0cc22839f9..2ac2f3e8d6 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -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 \ diff --git a/lisp/loadup.el b/lisp/loadup.el index 520fe4e701..c6a3e3f012 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -51,12 +51,13 @@ ;; 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) diff --git a/src/ChangeLog b/src/ChangeLog index e2ff15e429..36378fd911 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-12-16 Paul Eggert + + Fix problems with CANNOT_DUMP and EMACSLOADPATH. + * lread.c (init_lread): If CANNOT_DUMP, we can't be dumping. + 2013-12-16 Eli Zaretskii * xdisp.c (Fmove_point_visually): Fix subtle bugs in the fallback diff --git a/src/lread.c b/src/lread.c index 89bce5e7d2..2bada06f2a 100644 --- a/src/lread.c +++ b/src/lread.c @@ -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); -- 2.20.1