[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115509: Unconditionally reset load-path after dumpi
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] trunk r115509: Unconditionally reset load-path after dumping |
Date: |
Fri, 13 Dec 2013 18:25:35 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115509
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16107
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Fri 2013-12-13 13:25:30 -0500
message:
Unconditionally reset load-path after dumping
* src/lread.c: (dump_path): Remove.
(load-path-default): Remove `changed' argument.
Do not set dump_path permanently. Simplify.
(init_lread): Simplify.
(syms_of_lread): Remove dump_path.
* lisp/loadup.el (load-path): Warn if site-load or site-init changes it.
No more need to reset it when bootstrapping.
* doc/lispref/internals.texi (Building Emacs):
* doc/lispref/loading.texi (Library Search): Mention that site-load,
site-init cannot change load-path.
* INSTALL: No longer mention load-path and site-init/site-load.
* etc/NEWS: Mention this.
modified:
ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1538
INSTALL install-20091113204419-o5vbwnq5f7feedwu-581
doc/lispref/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-6155
doc/lispref/internals.texi
internals.texi-20091113204419-o5vbwnq5f7feedwu-6188
doc/lispref/loading.texi
loading.texi-20091113204419-o5vbwnq5f7feedwu-6193
etc/NEWS news-20100311060928-aoit31wvzf25yr1z-1
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/loadup.el loadup.el-20091113204419-o5vbwnq5f7feedwu-49
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/lread.c lread.c-20091113204419-o5vbwnq5f7feedwu-266
=== modified file 'ChangeLog'
--- a/ChangeLog 2013-12-12 22:41:31 +0000
+++ b/ChangeLog 2013-12-13 18:25:30 +0000
@@ -1,3 +1,7 @@
+2013-12-13 Glenn Morris <address@hidden>
+
+ * INSTALL: No longer mention load-path and site-init/site-load.
+
2013-12-12 Glenn Morris <address@hidden>
* Makefile.in (install-info): Handle missing info/dir.
=== modified file 'INSTALL'
--- a/INSTALL 2013-09-20 16:33:46 +0000
+++ b/INSTALL 2013-12-13 18:25:30 +0000
@@ -468,10 +468,6 @@
variable should have. If you don't pay attention to what you are
doing, you'll make a mistake.
-If you set load-path to a different value in site-init.el or
-site-load.el, Emacs will use *precisely* that value when it starts up
-again. If you do this, you are on your own!
-
The `site-*.el' files are nonexistent in the distribution. You do not
need to create them if you have nothing to put in them.
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog 2013-12-12 22:41:31 +0000
+++ b/doc/lispref/ChangeLog 2013-12-13 18:25:30 +0000
@@ -1,3 +1,9 @@
+2013-12-13 Glenn Morris <address@hidden>
+
+ * internals.texi (Building Emacs):
+ * loading.texi (Library Search): Mention that site-load,
+ site-init cannot change load-path.
+
2013-12-12 Glenn Morris <address@hidden>
* elisp.texi: Tweak dircategory.
=== modified file 'doc/lispref/internals.texi'
--- a/doc/lispref/internals.texi 2013-04-23 18:57:44 +0000
+++ b/doc/lispref/internals.texi 2013-12-13 18:25:30 +0000
@@ -116,6 +116,11 @@
expect in an ordinary unmodified Emacs. If you feel you must override
normal features for your site, do it with @file{default.el}, so that
users can override your changes if they wish. @xref{Startup Summary}.
+Note that if either @file{site-load.el} or @file{site-init.el} changes
address@hidden, the changes will be lost after dumping.
address@hidden Search}. To make a permanent change to
address@hidden, use the @option{--enable-locallisppath} option
+of @command{configure}.
In a package that can be preloaded, it is sometimes necessary (or
useful) to delay certain evaluations until Emacs subsequently starts
=== modified file 'doc/lispref/loading.texi'
--- a/doc/lispref/loading.texi 2013-11-27 06:15:06 +0000
+++ b/doc/lispref/loading.texi 2013-12-13 18:25:30 +0000
@@ -361,12 +361,10 @@
(push "~/.emacs.d/lisp" load-path)
@end example
- Dumping Emacs uses a special value of @code{load-path}. If the
-value of @code{load-path} at the end of dumping is unchanged (that is,
-still the same special value), the dumped Emacs switches to the
-ordinary @code{load-path} value when it starts up, as described above.
-But if @code{load-path} has any other value at the end of dumping,
-that value is used for execution of the dumped Emacs also.
+ Dumping Emacs uses a special value of @code{load-path}. If you use
+a @file{site-load.el} or @file{site-init.el} file to customize the
+dumped Emacs (@pxref{Building Emacs}), any changes to @code{load-path}
+that these files make will be lost after dumping.
@deffn Command locate-library library &optional nosuffix path interactive-call
This command finds the precise file name for library @var{library}. It
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2013-12-12 18:19:10 +0000
+++ b/etc/NEWS 2013-12-13 18:25:30 +0000
@@ -77,6 +77,12 @@
will instead append, if the argument begins with `:' (or `;' on MS Windows;
i.e., `path-separator').
++++
+** If you use either site-load.el or site-init.el to customize the dumped
+Emacs executable, any changes to `load-path' that these files make
+will no longer be present after dumping. To affect a permanent change
+to `load-path', use the `--enable-locallisppath' option of `configure'.
+
* Changes in Emacs 24.4
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-12-13 18:18:19 +0000
+++ b/lisp/ChangeLog 2013-12-13 18:25:30 +0000
@@ -1,3 +1,8 @@
+2013-12-13 Glenn Morris <address@hidden>
+
+ * loadup.el (load-path): Warn if site-load or site-init changes it.
+ No more need to reset it when bootstrapping.
+
2013-12-13 Teodor Zlatanov <address@hidden>
* progmodes/cfengine.el (cfengine-cf-promises): Add more default
=== modified file 'lisp/loadup.el'
--- a/lisp/loadup.el 2013-11-29 18:36:31 +0000
+++ b/lisp/loadup.el 2013-12-13 18:25:30 +0000
@@ -46,9 +46,6 @@
;; Add subdirectories to the load-path for files that might get
;; autoloaded when bootstrapping.
;; This is because PATH_DUMPLOADSEARCH is just "../lisp".
-;; Note that we reset load-path below just before dumping,
-;; since lread.c:init_lread checks for changes to load-path
-;; in deciding whether to modify it.
(if (or (equal (nth 3 command-line-args) "bootstrap")
(equal (nth 4 command-line-args) "bootstrap")
;; FIXME this is irritatingly fragile.
@@ -293,8 +290,15 @@
;; you may load them with a "site-load.el" file.
;; But you must also cause them to be scanned when the DOC file
;; is generated.
-;; For other systems, you must edit ../src/Makefile.in.
-(load "site-load" t)
+(let ((lp load-path))
+ (load "site-load" t)
+ ;; We reset load-path after dumping.
+ ;; For a permanent change in load-path, use configure's
+ ;; --enable-locallisppath option.
+ ;; See http://debbugs.gnu.org/16107 for more details.
+ (or (equal lp load-path)
+ (message "Warning: Change in load-path due to site-load will be \
+lost after dumping")))
;; Make sure default-directory is unibyte when dumping. This is
;; because we cannot decode and encode it correctly (since the locale
@@ -342,8 +346,13 @@
;; Note: You can cause additional libraries to be preloaded
;; by writing a site-init.el that loads them.
-;; See also "site-load" above.
-(load "site-init" t)
+;; See also "site-load" above
+(let ((lp load-path))
+ (load "site-init" t)
+ (or (equal lp load-path)
+ (message "Warning: Change in load-path due to site-init will be \
+lost after dumping")))
+
(setq current-load-list nil)
;; We keep the load-history data in PURE space.
@@ -353,11 +362,6 @@
(set-buffer-modified-p nil)
-;; reset the load-path. See lread.c:init_lread why.
-(if (or (equal (nth 3 command-line-args) "bootstrap")
- (equal (nth 4 command-line-args) "bootstrap"))
- (setcdr load-path nil))
-
(remove-hook 'after-load-functions (lambda (f) (garbage-collect)))
(setq inhibit-load-charset-map nil)
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-12-13 15:55:23 +0000
+++ b/src/ChangeLog 2013-12-13 18:25:30 +0000
@@ -1,3 +1,12 @@
+2013-12-13 Glenn Morris <address@hidden>
+
+ * lread.c: Unconditionally reset load-path after dumping. (Bug#16107)
+ (dump_path): Remove.
+ (load-path-default): Remove `changed' argument.
+ Do not set dump_path permanently. Simplify.
+ (init_lread): Simplify.
+ (syms_of_lread): Remove dump_path.
+
2013-12-13 Dmitry Antipov <address@hidden>
* alloc.c, font.c, font.h, ftfont.c, ftxfont.c, macfont.m,
=== modified file 'src/lread.c'
--- a/src/lread.c 2013-12-01 22:33:13 +0000
+++ b/src/lread.c 2013-12-13 18:25:30 +0000
@@ -4128,10 +4128,6 @@
}
}
-/* Record the value of load-path used at the start of dumping
- so we can see if the site changed it later during dumping. */
-static Lisp_Object dump_path;
-
/* Return the default load-path, to be used if EMACSLOADPATH is unset.
This does not include the standard site-lisp directories
under the installation prefix (i.e., PATH_SITELOADSEARCH),
@@ -4145,18 +4141,16 @@
If purify-flag (ie dumping) just use PATH_DUMPLOADSEARCH.
Otherwise use PATH_LOADSEARCH.
- If !initialized, then just set dump_path and return PATH_DUMPLOADSEARCH.
- If initialized, then if Vload_path != dump_path, return just Vload_path.
- (Presumably the load-path has already been changed by something.
- This can only be from a site-load file during dumping.)
+ If !initialized, then just return PATH_DUMPLOADSEARCH.
+ If initialized:
If Vinstallation_directory is not nil (ie, running uninstalled):
If installation-dir/lisp exists and not already a member,
we must be running uninstalled. Reset the load-path
to just installation-dir/lisp. (The default PATH_LOADSEARCH
refers to the eventual installation directories. Since we
are not yet installed, we should not use them, even if they exist.)
- If installation-dir/lisp does not exist, just add dump_path at the
- end instead.
+ If installation-dir/lisp does not exist, just add
+ PATH_DUMPLOADSEARCH at the end instead.
Add installation-dir/site-lisp (if !no_site_lisp, and exists
and not already a member) at the front.
If installation-dir != source-dir (ie running an uninstalled,
@@ -4165,7 +4159,7 @@
check), then repeat the above steps for source-dir/lisp, site-lisp. */
static Lisp_Object
-load_path_default (bool changed)
+load_path_default ()
{
Lisp_Object lpath = Qnil;
const char *normal;
@@ -4186,131 +4180,108 @@
normal = NILP (Vpurify_flag) ? PATH_LOADSEARCH : PATH_DUMPLOADSEARCH;
- /* In a dumped Emacs, we normally reset the value of Vload_path using
- PATH_LOADSEARCH, since the value that was dumped uses lisp/ in
- the source directory, instead of the path of the installed elisp
- libraries. However, if it appears that Vload_path has already been
- changed from the default that was saved before dumping, don't
- change it further. Changes can only be due to site-lisp
- files that were processed during dumping. */
- /* FIXME? AFAICS, it does not make sense to change load-path in a
- dumped site-lisp file, so maybe we should just drop this check.
- E.g., if you add an element to load-path, you are going to be
- adding it to PATH_DUMPLOADSEARCH, which refers to the source directory.
- This will make no sense (and may not still exist) in an installed Emacs.
- And the only change it is sensible to make to load-path is to add
- something to the front, which you should do with configure's
- --enable-locallisppath option if you really want to have it dumped. */
if (initialized)
{
- if (changed || NILP (Fequal (dump_path, Vload_path)))
- {
- /* Do not make any changes. */
- return Vload_path;
- }
- else
- {
#ifdef HAVE_NS
- const char *loadpath = ns_load_path ();
- lpath = decode_env_path (0, loadpath ? loadpath : normal, 0);
+ const char *loadpath = ns_load_path ();
+ lpath = decode_env_path (0, loadpath ? loadpath : normal, 0);
#else
- lpath = decode_env_path (0, normal, 0);
+ lpath = decode_env_path (0, normal, 0);
#endif
- if (!NILP (Vinstallation_directory))
- {
- Lisp_Object tem, tem1;
-
- /* Add to the path the lisp subdir of the installation
- dir, if it is accessible. Note: in out-of-tree builds,
- this directory is empty save for Makefile. */
- tem = Fexpand_file_name (build_string ("lisp"),
+ if (!NILP (Vinstallation_directory))
+ {
+ Lisp_Object tem, tem1;
+
+ /* Add to the path the lisp subdir of the installation
+ dir, if it is accessible. Note: in out-of-tree builds,
+ this directory is empty save for Makefile. */
+ tem = Fexpand_file_name (build_string ("lisp"),
+ Vinstallation_directory);
+ tem1 = Ffile_accessible_directory_p (tem);
+ if (!NILP (tem1))
+ {
+ if (NILP (Fmember (tem, lpath)))
+ {
+ /* We are running uninstalled. The default load-path
+ points to the eventual installed lisp directories.
+ We should not use those now, even if they exist,
+ so start over from a clean slate. */
+ lpath = list1 (tem);
+ }
+ }
+ else
+ /* That dir doesn't exist, so add the build-time
+ Lisp dirs instead. */
+ {
+ Lisp_Object dump_path =
+ decode_env_path (0, PATH_DUMPLOADSEARCH, 0);
+ lpath = nconc2 (lpath, dump_path);
+ }
+
+ /* Add site-lisp under the installation dir, if it exists. */
+ if (!no_site_lisp)
+ {
+ tem = Fexpand_file_name (build_string ("site-lisp"),
Vinstallation_directory);
tem1 = Ffile_accessible_directory_p (tem);
if (!NILP (tem1))
{
if (NILP (Fmember (tem, lpath)))
- {
- /* We are running uninstalled. The default load-path
- points to the eventual installed lisp directories.
- We should not use those now, even if they exist,
- so start over from a clean slate. */
- lpath = list1 (tem);
- }
- }
- else
- /* That dir doesn't exist, so add the build-time
- Lisp dirs instead. */
- lpath = nconc2 (lpath, dump_path);
-
- /* Add site-lisp under the installation dir, if it exists. */
- if (!no_site_lisp)
- {
- tem = Fexpand_file_name (build_string ("site-lisp"),
- Vinstallation_directory);
- tem1 = Ffile_accessible_directory_p (tem);
- if (!NILP (tem1))
- {
- if (NILP (Fmember (tem, lpath)))
- lpath = Fcons (tem, lpath);
- }
- }
-
- /* 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 that directory. */
-
- if (NILP (Fequal (Vinstallation_directory, Vsource_directory)))
- {
- Lisp_Object tem2;
-
- tem = Fexpand_file_name (build_string ("src/Makefile"),
- Vinstallation_directory);
- tem1 = Ffile_exists_p (tem);
-
- /* Don't be fooled if they moved the entire source tree
- AFTER dumping Emacs. If the build directory is indeed
- different from the source dir, src/Makefile.in and
- src/Makefile will not be found together. */
- tem = Fexpand_file_name (build_string ("src/Makefile.in"),
- Vinstallation_directory);
- tem2 = Ffile_exists_p (tem);
- if (!NILP (tem1) && NILP (tem2))
- {
- tem = Fexpand_file_name (build_string ("lisp"),
+ lpath = Fcons (tem, lpath);
+ }
+ }
+
+ /* 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 that directory. */
+
+ if (NILP (Fequal (Vinstallation_directory, Vsource_directory)))
+ {
+ Lisp_Object tem2;
+
+ tem = Fexpand_file_name (build_string ("src/Makefile"),
+ Vinstallation_directory);
+ tem1 = Ffile_exists_p (tem);
+
+ /* Don't be fooled if they moved the entire source tree
+ AFTER dumping Emacs. If the build directory is indeed
+ different from the source dir, src/Makefile.in and
+ src/Makefile will not be found together. */
+ tem = Fexpand_file_name (build_string ("src/Makefile.in"),
+ Vinstallation_directory);
+ tem2 = Ffile_exists_p (tem);
+ if (!NILP (tem1) && NILP (tem2))
+ {
+ tem = Fexpand_file_name (build_string ("lisp"),
+ Vsource_directory);
+
+ if (NILP (Fmember (tem, lpath)))
+ lpath = Fcons (tem, lpath);
+
+ if (!no_site_lisp)
+ {
+ tem = Fexpand_file_name (build_string ("site-lisp"),
Vsource_directory);
-
- if (NILP (Fmember (tem, lpath)))
- lpath = Fcons (tem, lpath);
-
- if (!no_site_lisp)
+ tem1 = Ffile_accessible_directory_p (tem);
+ if (!NILP (tem1))
{
- tem = Fexpand_file_name (build_string ("site-lisp"),
- Vsource_directory);
- tem1 = Ffile_accessible_directory_p (tem);
- if (!NILP (tem1))
- {
- if (NILP (Fmember (tem, lpath)))
- lpath = Fcons (tem, lpath);
- }
+ if (NILP (Fmember (tem, lpath)))
+ lpath = Fcons (tem, lpath);
}
}
- } /* Vinstallation_directory != Vsource_directory */
-
- } /* if Vinstallation_directory */
-
- } /* if dump_path == Vload_path */
+ }
+ } /* Vinstallation_directory != Vsource_directory */
+
+ } /* if Vinstallation_directory */
}
else /* !initialized */
{
/* NORMAL refers to PATH_DUMPLOADSEARCH, ie the lisp dir in the
source directory. We used to add ../lisp (ie the lisp dir in
- the build directory) at the front here, but that caused trouble
- because it was copied from dump_path into Vload_path, above,
- when Vinstallation_directory was non-nil. It should not be
- necessary, since in out of tree builds lisp/ is empty, save
+ the build directory) at the front here, but that should not
+ be necessary, since in out of tree builds lisp/ is empty, save
for Makefile. */
lpath = decode_env_path (0, normal, 0);
- dump_path = lpath;
}
#endif /* !CANNOT_DUMP */
@@ -4322,27 +4293,20 @@
{
/* First, set Vload_path. */
- /* NB: Do not change Vload_path before calling load_path_default,
- since it may check it against dump_path.
- (This behavior could be changed.) */
-
/* We explicitly ignore EMACSLOADPATH when dumping. */
if (NILP (Vpurify_flag) && egetenv ("EMACSLOADPATH"))
{
- Lisp_Object elpath = decode_env_path ("EMACSLOADPATH", 0, 1);
+ Vload_path = decode_env_path ("EMACSLOADPATH", 0, 1);
/* Check (non-nil) user-supplied elements. */
- load_path_check (elpath);
+ load_path_check (Vload_path);
/* If no nils in the environment variable, use as-is.
Otherwise, replace any nils with the default. */
- if (NILP (Fmemq (Qnil, elpath)))
- {
- Vload_path = elpath;
- }
- else
- {
- Lisp_Object elem, default_lpath = load_path_default (0);
+ if (! NILP (Fmemq (Qnil, Vload_path)))
+ {
+ Lisp_Object elem, elpath = Vload_path;
+ Lisp_Object default_lpath = load_path_default ();
/* Check defaults, before adding site-lisp. */
load_path_check (default_lpath);
@@ -4372,13 +4336,7 @@
}
else /* Vpurify_flag || !EMACSLOADPATH */
{
-#ifdef CANNOT_DUMP
- bool changed = 0;
-#else
- bool changed = initialized && NILP (Fequal (dump_path, Vload_path));
-#endif
-
- Vload_path = load_path_default (changed);
+ Vload_path = load_path_default ();
/* Check before adding site-lisp directories.
The install should have created them, but they are not
@@ -4386,10 +4344,8 @@
Or we might be running before installation. */
load_path_check (Vload_path);
- /* Add the site-lisp directories at the front, unless the
- load-path has already been changed.
- FIXME? Should we ignore changed here? */
- if (initialized && !no_site_lisp && !changed)
+ /* Add the site-lisp directories at the front. */
+ if (initialized && !no_site_lisp)
{
Lisp_Object sitelisp;
sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);
@@ -4694,8 +4650,6 @@
DEFSYM (Qdir_ok, "dir-ok");
DEFSYM (Qdo_after_load_evaluation, "do-after-load-evaluation");
- staticpro (&dump_path);
-
staticpro (&read_objects);
read_objects = Qnil;
staticpro (&seen_list);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115509: Unconditionally reset load-path after dumping,
Glenn Morris <=