File: package.el.html
The idea behind package.el is to be able to download packages and install them. Packages are versioned and have versioned dependencies. Furthermore, this supports built-in packages which may or may not be newer than user-specified packages. This makes it possible to upgrade Emacs and automatically disable packages which have moved from external to core. (Note though that we don't currently register any of these, so this feature does not actually work.)
A package is described by its name and version. The distribution format is either a tar file or a single .el file.
A tar file should be named "NAME-VERSION.tar". The tar file must
unpack into a directory named after the package and version:
"NAME-VERSION". It must contain a file named "PACKAGE-pkg.el"
which consists of a call to define-package. It may also contain a
"dir" file and the info files it references.
A .el file is named "NAME-VERSION.el" in the remote archive, but is installed as simply "NAME.el" in a directory named "NAME-VERSION".
The downloader downloads all dependent packages. By default,
packages come from the official GNU sources, but others may be
added by customizing the package-archives alist. Packages get
byte-compiled at install time.
At activation time we will set up the load-path and the info path, and we will load the package's autoloads. If a package's dependencies are not available, we will not activate that package.
Conceptually a package has multiple state transitions:
* Download. Fetching the package from ELPA.
* Install. Untar the package, or write the .el file, into
~/.emacs.d/elpa/ directory.
* Autoload generation.
* Byte compile. Currently this phase is done during install,
but we may change this.
* Activate. Evaluate the autoloads for the package to make it
available to the user.
* Load. Actually load the package and run some code from it.
Other external functions you may want to use:
M-x list-packages
Enters a mode similar to buffer-menu which lets you manage
packages. You can choose packages for install (mark with "i",
then "x" to execute) or deletion, and you can see what packages
are available. This will automatically fetch the latest list of
packages from ELPA.
M-x package-install-from-buffer
Install a package consisting of a single .el file that appears
in the current buffer. This only works for packages which
define a Version header properly; package.el also supports the
extension headers Package-Version (in case Version is an RCS id
or similar), and Package-Requires (if the package requires other
packages).
M-x package-install-file
Install a package from the indicated file. The package can be
either a tar file or a .el file. A tar file must contain an
appropriately-named "-pkg.el" file; a .el file must be properly
formatted as with package-install-from-buffer.
Defined variables (52)
package--activated | Non-nil if ‘package-activate-all’ has been run. |
package--builtins | Alist of built-in packages. |
package--compatibility-table | Hash table connecting package names to their compatibility. |
package--downloads-in-progress | List of in-progress asynchronous downloads. |
package--emacs-version-list | The value of variable ‘emacs-version’ as a list. |
package--initialized | Non-nil if ‘package-initialize’ has been run. |
package--old-archive-priorities | Store currently used ‘package-archive-priorities’. |
package--post-download-archives-hook | Hook run after the archive contents are downloaded. |
package--quickstart-dir | Set by ‘package-quickstart-file’ to the directory containing it. |
package--quickstart-pkgs | If set to a list, we’re computing the set of pkgs to activate. |
package-activated-list | List of the names of currently activated packages. |
package-alist | Alist of all packages available for activation. |
package-archive-column-width | Column width for the Package archive in the package menu. |
package-archive-contents | Cache of the contents of all archives in ‘package-archives’. |
package-archive-priorities | An alist of priorities for packages. |
package-archive-version | Version number of the package archive understood by package.el. |
package-archives | An alist of archives from which to fetch. |
package-check-signature | Non-nil means to check package signatures when installing. |
package-directory-list | List of additional directories containing Emacs Lisp packages. |
package-enable-at-startup | Whether to make installed packages available when Emacs starts. |
package-gnupghome-dir | Directory containing GnuPG keyring or nil. |
package-hidden-regexps | List of regexps matching the name of packages to hide. |
package-install-upgrade-built-in | Non-nil means that built-in packages can be upgraded via a package archive. |
package-list-unsigned | If non-nil, mention in the list which packages were installed without signature. |
package-list-unversioned | If non-nil, include packages that don’t have a version in ‘list-packages’. |
package-load-list | List of packages for ‘package-activate-all’ to make available. |
package-menu--hide-packages | Whether available obsolete packages should be hidden. |
package-menu--mark-upgrades-pending | Whether mark-upgrades is waiting for a refresh to finish. |
package-menu--new-package-list | List of newly-available packages since ‘list-packages’ was last called. |
package-menu--old-archive-contents | ‘package-archive-contents’ before the latest refresh. |
package-menu--transaction-status | Mode-line status of ongoing package transaction. |
package-menu-async | If non-nil, package-menu will use async operations when possible. |
package-menu-hide-low-priority | If non-nil, hide low priority packages from the packages menu. |
package-menu-mode-abbrev-table | Abbrev table for ‘package-menu-mode’. |
package-menu-mode-hook | Hook run after entering ‘package-menu-mode’. |
package-menu-mode-line-info | Variable which stores package-menu mode-line format. |
package-menu-mode-map | Local keymap for ‘package-menu-mode’ buffers. |
package-menu-mode-menu | Menu for ‘package-menu-mode’. |
package-menu-mode-syntax-table | Syntax table for ‘package-menu-mode’. |
package-menu-use-current-if-no-marks | Whether x in package menu operates on current package if none are marked. |
package-name-column-width | Column width for the Package name in the package menu. |
package-native-compile | Non-nil means to natively compile packages as part of their installation. |
package-pinned-packages | An alist of packages that are pinned to specific archives. |
package-quickstart | Precompute activation actions to speed up startup. |
package-quickstart-file | Location of the file used to speed up activation of packages at startup. |
package-read-archive-hook | List of functions to call to read the archive contents. |
package-refresh-contents-hook | List of functions to call to refresh the package archive. |
package-selected-packages | Store here packages installed explicitly by user. |
package-status-column-width | Column width for the Package status in the package menu. |
package-unsigned-archives | List of archives where we do not check for package signatures. |
package-user-dir | Directory containing the user’s Emacs Lisp packages. |
package-version-column-width | Column width for the Package version in the package menu. |
Defined functions (233)
Defined faces (21)
package-description | Face used on package description summaries in the package menu. |
package-help-section-name | Face used on section names in package description buffers. |
package-mark-delete-line | Face used for highlighting in package-menu packages marked to be deleted. |
package-mark-install-line | Face used for highlighting in package-menu packages marked to be installed. |
package-mode-line-installed | Face for the number of installed packages displayed on the mode line. |
package-mode-line-new | Face for the number of new packages displayed on the mode line. |
package-mode-line-to-upgrade | Face for the number of packages to upgrade displayed on the mode line. |
package-mode-line-total | Face for the total number of packages displayed on the mode line. |
package-name | Face used on package names in the package menu. |
package-status-avail-obso | Face used on the status and version of avail-obso packages. |
package-status-available | Face used on the status and version of available packages. |
package-status-built-in | Face used on the status and version of built-in packages. |
package-status-dependency | Face used on the status and version of dependency packages. |
package-status-disabled | Face used on the status and version of disabled packages. |
package-status-external | Face used on the status and version of external packages. |
package-status-from-source | Face used on the status and version of installed packages. |
package-status-held | Face used on the status and version of held packages. |
package-status-incompat | Face used on the status and version of incompat packages. |
package-status-installed | Face used on the status and version of installed packages. |
package-status-new | Face used on the status and version of new packages. |
package-status-unsigned | Face used on the status and version of unsigned packages. |