Add early init file, stop package-initialize insertion
commit24acb31c04b4048b85311d794e600ecd7ce60d3b
authorRadon Rosborough <radon.neon@gmail.com>
Sat, 17 Feb 2018 11:36:16 +0000 (17 13:36 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 17 Feb 2018 11:36:16 +0000 (17 13:36 +0200)
tree0a5a8c098c07b0f69f5ac96be546dc8c43013880
parent8224430bd9d71dfcf2524b758d8ac14a1d93b0d5
Add early init file, stop package-initialize insertion

Discussion on emacs-devel leading up to this change (approximately 150
messages):

- https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00154.html
- https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00433.html
- https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00023.html
- https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00599.html
- https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00332.html

* lisp/startup.el (early-init-file): New variable.
(load-user-init-file): New function.
(command-line): Load the early init file using `load-user-init-file'.
Move the check for an invalid username to just before that, and move
the initialization of the package system to just after.  Load the
regular init file using `load-user-init-file'.
* lisp/emacs-lisp/package.el (package--ensure-init-file): Remove
definition, usage, and documentation.
(package--init-file-ensured): Remove definition and usage.

* src/lread.c (Vuser_init_file): Note change in semantics due to its
usage while loading the early init file.

* doc/emacs/custom.texi: Document early init file.
* doc/emacs/package.texi: Document changes to when package-initialize
is called.  Change terminology for package 'loading'.
* doc/lispref/os.texi: Document early init file.  Update startup
summary.
* doc/lispref/package.texi: Document changes to when
package-initialize is called, and advise against calling it in the
init file.  Change terminology for package 'loading'.
* doc/misc/org.texi: Don't recommend to call package-initialize in the
init file.
doc/emacs/custom.texi
doc/emacs/emacs.texi
doc/emacs/package.texi
doc/lispref/os.texi
doc/lispref/package.texi
doc/misc/org.texi
etc/NEWS
lisp/emacs-lisp/package.el
lisp/startup.el
src/lread.c