mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2026-09-10 07:46:51 -04:00
List all packages in 'package-install' prompt
* lisp/emacs-lisp/package.el (package-install-upgrade-built-in): Update documentation. * lisp/emacs-lisp/package.el (package-install): Raise error when re-installing an installed package. (Bug#79881)
This commit is contained in:
parent
808d4a2133
commit
5744519ef4
|
|
@ -2243,8 +2243,9 @@ using `package-compute-transaction'."
|
||||||
|
|
||||||
(defcustom package-install-upgrade-built-in nil
|
(defcustom package-install-upgrade-built-in nil
|
||||||
"Non-nil means that built-in packages can be upgraded via a package archive.
|
"Non-nil means that built-in packages can be upgraded via a package archive.
|
||||||
If disabled, then `package-install' will not suggest to replace a
|
If disabled, then `package-install' will raise an error when trying to
|
||||||
built-in package with a (possibly newer) version from a package archive."
|
replace a built-in package with a (possibly newer) version from a
|
||||||
|
package archive."
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
:version "29.1")
|
:version "29.1")
|
||||||
|
|
||||||
|
|
@ -2275,17 +2276,14 @@ had been enabled."
|
||||||
(package--archives-initialize)
|
(package--archives-initialize)
|
||||||
(list (intern (completing-read
|
(list (intern (completing-read
|
||||||
"Install package: "
|
"Install package: "
|
||||||
(mapcan
|
package-archive-contents
|
||||||
(lambda (elt)
|
|
||||||
(and (or (and (or current-prefix-arg
|
|
||||||
package-install-upgrade-built-in)
|
|
||||||
(package--active-built-in-p (car elt)))
|
|
||||||
(not (package-installed-p (car elt))))
|
|
||||||
(list (symbol-name (car elt)))))
|
|
||||||
package-archive-contents)
|
|
||||||
nil t))
|
nil t))
|
||||||
nil)))
|
nil)))
|
||||||
(cl-check-type pkg (or symbol package-desc))
|
(cl-check-type pkg (or symbol package-desc))
|
||||||
|
(when (or (and package-install-upgrade-built-in
|
||||||
|
(package--active-built-in-p pkg))
|
||||||
|
(package-installed-p pkg))
|
||||||
|
(user-error "Package is already installed"))
|
||||||
(package--archives-initialize)
|
(package--archives-initialize)
|
||||||
(add-hook 'post-command-hook #'package-menu--post-refresh)
|
(add-hook 'post-command-hook #'package-menu--post-refresh)
|
||||||
(let ((name (if (package-desc-p pkg)
|
(let ((name (if (package-desc-p pkg)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue