Commit 06a4f110 authored by Glenn Morris's avatar Glenn Morris

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.

Fixes: debbugs:16107
parent 978a5fda
2013-12-13 Glenn Morris <rgm@gnu.org>
* INSTALL: No longer mention load-path and site-init/site-load.
2013-12-12 Glenn Morris <rgm@gnu.org>
* Makefile.in (install-info): Handle missing info/dir.
......
......@@ -468,10 +468,6 @@ variable gets by default! Make sure you know what kind of value the
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.
......
2013-12-13 Glenn Morris <rgm@gnu.org>
* internals.texi (Building Emacs):
* loading.texi (Library Search): Mention that site-load,
site-init cannot change load-path.
2013-12-12 Glenn Morris <rgm@gnu.org>
* elisp.texi: Tweak dircategory.
......
......@@ -116,6 +116,11 @@ time.)
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
@code{load-path}, the changes will be lost after dumping.
@xref{Library Search}. To make a permanent change to
@code{load-path}, 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
......
......@@ -361,12 +361,10 @@ add one or more directories to @code{load-path}. For example:
(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
......
......@@ -77,6 +77,12 @@ was replaced by ".", so use an explicit "." now if that is what you want.)
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
......
2013-12-13 Glenn Morris <rgm@gnu.org>
* 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 <tzz@lifelogs.com>
* progmodes/cfengine.el (cfengine-cf-promises): Add more default
......
......@@ -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)
......
2013-12-13 Glenn Morris <rgm@gnu.org>
* 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 <dmantipov@yandex.ru>
* alloc.c, font.c, font.h, ftfont.c, ftxfont.c, macfont.m,
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment