summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAaron Ecay <aaronecay@gmail.com>2015-10-05 20:55:58 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-10-06 19:38:11 +0100
commit81558130c1f7c55d1c9c69d9a1a7ec174f9589a3 (patch)
treed4e8f56aa4c440903d86ecc38359fb8f4df9c7af /lisp/emacs-lisp
parente2b1ad428c10b012abaa72749976732f7b584bbd (diff)
downloademacs-81558130c1f7c55d1c9c69d9a1a7ec174f9589a3.tar.gz
emacs-81558130c1f7c55d1c9c69d9a1a7ec174f9589a3.tar.bz2
emacs-81558130c1f7c55d1c9c69d9a1a7ec174f9589a3.zip
lisp/emacs-lisp/package.el (package-install): Fix name error
* lisp/emacs-lisp/package.el (package-install): Fix error when pkg is not a package-desc object. Also clarify documentation. (Bug#21625)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/package.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index eb66e8f25a3..89f2a1a011b 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1887,7 +1887,7 @@ add a call to it along with some explanatory comments."
;;;###autoload
(defun package-install (pkg &optional dont-select)
"Install the package PKG.
-PKG can be a package-desc or the package name of one the available packages
+PKG can be a package-desc or a symbol naming one of the available packages
in an archive in `package-archives'. Interactively, prompt for its name.
If called interactively or if DONT-SELECT nil, add PKG to
@@ -1918,15 +1918,15 @@ to install it but still mark it as selected."
pkg)))
(unless (or dont-select (package--user-selected-p name))
(package--save-selected-packages
- (cons name package-selected-packages))))
- (if-let ((transaction
- (if (package-desc-p pkg)
- (unless (package-installed-p pkg)
- (package-compute-transaction (list pkg)
- (package-desc-reqs pkg)))
- (package-compute-transaction () (list (list pkg))))))
- (package-download-transaction transaction)
- (message "`%s' is already installed" (package-desc-full-name pkg))))
+ (cons name package-selected-packages)))
+ (if-let ((transaction
+ (if (package-desc-p pkg)
+ (unless (package-installed-p pkg)
+ (package-compute-transaction (list pkg)
+ (package-desc-reqs pkg)))
+ (package-compute-transaction () (list (list pkg))))))
+ (package-download-transaction transaction)
+ (message "`%s' is already installed" name))))
(defun package-strip-rcs-id (str)
"Strip RCS version ID from the version string STR.