* lisp/emacs-lisp/package.el (package-isolate): Use
'package--archive-contents' instead of the actual variable, to
ensure that we load the archive contents if missing. This is
likely the case if 'package-isolate' is the first package
function invoked during a session.
* lisp/emacs-lisp/package.el (package--removable-packages):
Handle the fact that 'package--dependencies' doesn't return the
package itself as a dependency, so we have to check
'package-selected-packages' separately. Also fix the way we
check the return value of 'package--dependencies', keeping in
mind that the value is an alist. (Bug#80907)
This is a partial reversion of 931e04a34b.
* lisp/emacs-lisp/package.el (package--builtin-alist): Add a
function that loads 'finder-inf', which in turn will populate
'package--builtins', if necessary, caching the result.
(package--upgradeable-packages, describe-package-1)
(package-menu--refresh, package--mapc, package-get-descriptor):
Use the function instead of the variable.
* lisp/emacs-lisp/package.el (package-get-descriptor): Use
'assq' to look up element in package alists instead of iterative
over them manually. This was initially not possible, since we
merged all alists into one, which would require using a consing
function like 'map-merge-with' to look up all package descriptor
objects we want to consider in a single 'assq' call. As we
ended up not merging lists, we can assume that there are no
duplicate keys in the alists, making the efficient 'assq'
viable.
* lisp/emacs-lisp/package.el (package--compatible-packages):
Drop 'package-read-all-archive-contents' call, as
'package--build-compatibility-table' will load the archive
contents on demand via 'package--mapc' anyway. (Bug#80902)
* lisp/emacs-lisp/package.el (package--builtin-alist):
(package--upgradeable-packages, package--mapc)
(package-get-descriptor):
* lisp/emacs-lisp/package.el (package--builtin-alist): Replace
function with constant, as the result of the function is always
the same within an Emacs session, since the set of built-in
packages don't change during execution.
(package--upgradeable-packages, package--mapc)
(package-get-descriptor): Use variable instead of function.
(package-menu--refresh, describe-package-1): Lookup desc in
alist instead of calling 'package--from-builtin'.
(Bug#80902)
The general idea here is to make it easier to handle situations
where you might have a symbol designating a package name or a
'package-desc' object, but you really want the latter.
* lisp/emacs-lisp/package.el (package--get-deps): Remove
function superseded by 'package--dependencies'.
(package--builtin-alist, package--archive-contents): Add new
functions.
(package--removable-packages): Use 'package--dependencies'.
(package--dependencies): Check for circular dependencies.
(package-upgrade, package--upgradeable-packages)
(package--user-installed-p, package-reinstall, package-recompile)
(describe-package-1, package-desc-status, package--mapc)
(package-menu--find-upgrades): Use 'package-get-descriptor'.
(package-get-descriptor): Add optional arguments to allow for
different kinds of queries.
* lisp/emacs-lisp/package-vc.el
(package-vc-install-selected-packages)
(package-vc--generate-description-file)
(package-vc-install-dependencies, package-vc--read-package-desc)
(package-vc-install, package-vc-checkout): Use
'package-get-descriptor'.
* lisp/emacs-lisp/package.el (package-install-file): Assume it
is OK to set the visited file name, since we are not actually
touching anything on disk, and prevent the modified flag from
preventing us to kill the temporary buffer. The flag is set by
tar-mode.
* lisp/emacs-lisp/package.el (package--review-git-diff-command):
Add new constant to avoid duplicating the exact command as the
default value and in the type of the user option.
(package-review-diff-command): Use git-diff(1) if Git is
installed, and fall back to regular diff(1) otherwise. The
previous default value has been moved to the user option, as a
suggested alternative.
(package-review): Support the ability to use symbols, that get
replaced and expanded into the list of switches.
(Bug#80684)
Co-Authored-By: Daniel Mendler <mail@daniel-mendler.de>
* lisp/emacs-lisp/package.el (package-menu-status-faces): Add
new constant.
(package-menu--print-info-simple): Replace 'pcase' form with
'alist-get', which is my measurements is slightly faster.
* lisp/emacs-lisp/package.el (package--compatible-packages): Add
new function.
(package-install): Use new function to restrict suggestions to
not include incompatible packages.
(package--incompatible-p): Check all dependencies to determine
package compatibility.
* etc/NEWS: Mention change. (Bug#80695)
* lisp/emacs-lisp/package.el (package--dependencies): Return
required dependency version along with every dependency.
(package-menu--list-to-prompt): Discard required versions.
* lisp/emacs-lisp/package.el (package-maintainers): Detect if
:maintainers contains on a single cons-cell, denoting a single
maintainer, in which case we wrap it in a singleton list.
* lisp/emacs-lisp/package.el (package--query-desc): Load
'package-alist' if this hasn't already occurred.
(package-report-bug): Drop unnecessary ALIST argument when
invoking 'package--query-desc'.
* lisp/emacs-lisp/package.el (package-maintainers): Add
fallbacks if a package doesn't list a single maintainer.
(package-report-bug): Check if "emacs-devel@gnu.org" is listed
as a maintainer, in which case the message is redirected to
bug-gnu-emacs@gnu.org and the X-Debbugs-CC header is set.
(Bug#80478)
* lisp/emacs-lisp/package.el (package-upgrade-keep-previous):
Rename user option to 'package-retention-policy'.
(package--policy-type): New constant for policy types.
(package-retention-policy): New option.
(package-review-policy): Use new type constant.
(package--review-p): Rename and generalise to
'package-matches-selector-p'.
(package-matches-selector-p): New function.
(package-upgrade, package-menu--mark-upgrades-1): Respect
'package-retention-policy'.
* doc/emacs/package.texi (Package Installation): Document new option.
* etc/NEWS: Update NEWS entry. (Bug#79957)
* lisp/emacs-lisp/package.el (package-isolate): Change
formatting to indicate dependencies to include a note if the
package was downloaded in a temporary directory.
* lisp/emacs-lisp/package.el (package-isolate): Do not use
destructive 'mapcan' to create a list of dependencies, as
'package-desc-reqs' doesn't return a fresh list.
This change adds a conditional to keep old package versions on upgrade.
This allows users to keep running multiple Emacsen without a package
upgrade in one Emacs breaking another running Emacs.
* lisp/emacs-lisp/package.el (package-upgrade-keep-previous):
New boolean user option.
(package-upgrade): Use it.
(package-menu--mark-upgrades-1): Use it.
(package-menu--find-upgrades): Make consistent with new option.
* etc/NEWS: Announce it.
(Bug#79957)
* lisp/emacs-lisp/package.el (package-upgrade): Trigger error
redirecting user to use 'package-vc-upgrade'.
(package--upgradeable-packages): Exclude VC packages from list
of "upgradable" packages.
* lisp/emacs-lisp/package.el (package-dir-info): Do not check
files that do not satisfy 'file-regular-p' when trying to find
the file with the package metadata. (Bug#79742)