diff options
| author | Stefan Monnier | 2018-03-26 09:41:30 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2018-03-26 09:41:30 -0400 |
| commit | 6dfdf0c9e8e4aca77b148db8d009c862389c64d3 (patch) | |
| tree | a400cdf3efa473bbf0b39218fbce9bfa61d92aee /doc/lispref | |
| parent | b300052fb4ef1261519b0fd57f5eb186c2d10295 (diff) | |
| download | emacs-6dfdf0c9e8e4aca77b148db8d009c862389c64d3.tar.gz emacs-6dfdf0c9e8e4aca77b148db8d009c862389c64d3.zip | |
* lisp/emacs-lisp/package.el: New quickstart feature
(package--quickstart-pkgs): New var.
(package-activate-1): Obey and fill it.
(package-activate-all): New function.
(package-initialize): Call it.
Set package-initialized before activating the packages.
(package-installed-p): Make it work before package.el is initialized in
the case where min-version is not specified.
(package-install, package-delete): Refresh the quickstart if applicable.
(package-quickstart, package-quickstart-file): New vars.
(package--quickstart-maybe-refresh, package-quickstart-refresh):
New functions.
* lisp/startup.el (command-line): Use package-activate-all rather than
package-initialize.
* doc/lispref/package.texi (Packaging Basics):
* doc/emacs/package.texi (Package Installation):
* doc/lispref/os.texi (Startup Summary): Refer to package-activate-all.
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/os.texi | 6 | ||||
| -rw-r--r-- | doc/lispref/package.texi | 24 |
2 files changed, 17 insertions, 13 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 0e30ad519a8..77ecb667f4f 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -103,12 +103,12 @@ was specified, Emacs looks for the init file in that user's home | |||
| 103 | directory instead. | 103 | directory instead. |
| 104 | 104 | ||
| 105 | @item | 105 | @item |
| 106 | It calls the function @code{package-initialize} to activate any | 106 | It calls the function @code{package-activate-all} to activate any |
| 107 | optional Emacs Lisp package that has been installed. @xref{Packaging | 107 | optional Emacs Lisp package that has been installed. @xref{Packaging |
| 108 | Basics}. However, Emacs doesn't initialize packages when | 108 | Basics}. However, Emacs doesn't activate the packages when |
| 109 | @code{package-enable-at-startup} is @code{nil} or when it's started | 109 | @code{package-enable-at-startup} is @code{nil} or when it's started |
| 110 | with one of the options @samp{-q}, @samp{-Q}, or @samp{--batch}. To | 110 | with one of the options @samp{-q}, @samp{-Q}, or @samp{--batch}. To |
| 111 | initialize packages in the latter case, @code{package-initialize} | 111 | activate the packages in the latter case, @code{package-activate-all} |
| 112 | should be called explicitly (e.g., via the @samp{--funcall} option). | 112 | should be called explicitly (e.g., via the @samp{--funcall} option). |
| 113 | 113 | ||
| 114 | @vindex initial-window-system@r{, and startup} | 114 | @vindex initial-window-system@r{, and startup} |
diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi index 7e7a8cd9bc8..37c1ee6697d 100644 --- a/doc/lispref/package.texi +++ b/doc/lispref/package.texi | |||
| @@ -105,16 +105,15 @@ adds the package's content directory to @code{load-path}, and | |||
| 105 | evaluates the autoload definitions in @file{@var{name}-autoloads.el}. | 105 | evaluates the autoload definitions in @file{@var{name}-autoloads.el}. |
| 106 | 106 | ||
| 107 | Whenever Emacs starts up, it automatically calls the function | 107 | Whenever Emacs starts up, it automatically calls the function |
| 108 | @code{package-initialize} to make installed packages available to the | 108 | @code{package-activate-all} to make installed packages available to the |
| 109 | current session. This is done after loading the early init file, but | 109 | current session. This is done after loading the early init file, but |
| 110 | before loading the regular init file (@pxref{Startup Summary}). | 110 | before loading the regular init file (@pxref{Startup Summary}). |
| 111 | Packages are not automatically made available if the user option | 111 | Packages are not automatically made available if the user option |
| 112 | @code{package-enable-at-startup} is set to @code{nil} in the early | 112 | @code{package-enable-at-startup} is set to @code{nil} in the early |
| 113 | init file. | 113 | init file. |
| 114 | 114 | ||
| 115 | @deffn Command package-initialize &optional no-activate | 115 | @defun package-activate-all |
| 116 | This function initializes Emacs' internal record of which packages are | 116 | This function makes the packages available to the current session. |
| 117 | installed, and makes the packages available to the current session. | ||
| 118 | The user option @code{package-load-list} specifies which packages to | 117 | The user option @code{package-load-list} specifies which packages to |
| 119 | make available; by default, all installed packages are made available. | 118 | make available; by default, all installed packages are made available. |
| 120 | If called during startup, this function also sets | 119 | If called during startup, this function also sets |
| @@ -122,15 +121,20 @@ If called during startup, this function also sets | |||
| 122 | evaluating package autoloads more than once. @xref{Package | 121 | evaluating package autoloads more than once. @xref{Package |
| 123 | Installation,,, emacs, The GNU Emacs Manual}. | 122 | Installation,,, emacs, The GNU Emacs Manual}. |
| 124 | 123 | ||
| 125 | The optional argument @var{no-activate}, if non-@code{nil}, causes | 124 | In most cases, you should not need to call @code{package-activate-all}, |
| 126 | Emacs to update its record of installed packages without actually | ||
| 127 | making them available; it is for internal use only. | ||
| 128 | |||
| 129 | In most cases, you should not need to call @code{package-initialize}, | ||
| 130 | as this is done automatically during startup. Simply make sure to put | 125 | as this is done automatically during startup. Simply make sure to put |
| 131 | any code that should run before @code{package-initialize} in the early | 126 | any code that should run before @code{package-activate-all} in the early |
| 132 | init file, and any code that should run after it in the primary init | 127 | init file, and any code that should run after it in the primary init |
| 133 | file (@pxref{Init File,,, emacs, The GNU Emacs Manual}). | 128 | file (@pxref{Init File,,, emacs, The GNU Emacs Manual}). |
| 129 | @end defun | ||
| 130 | |||
| 131 | @deffn Command package-initialize &optional no-activate | ||
| 132 | This function initializes Emacs' internal record of which packages are | ||
| 133 | installed, and then calls @code{package-activate-all}. | ||
| 134 | |||
| 135 | The optional argument @var{no-activate}, if non-@code{nil}, causes | ||
| 136 | Emacs to update its record of installed packages without actually | ||
| 137 | making them available. | ||
| 134 | @end deffn | 138 | @end deffn |
| 135 | 139 | ||
| 136 | @node Simple Packages | 140 | @node Simple Packages |