diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-04 15:17:06 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-04 15:17:06 +0000 |
commit | 102a21d68976ab9dc85304e0bc47b7562d3cf93f (patch) | |
tree | 0a33532724f01890eddc1927a66076bb35da1ddb | |
parent | 5687ac9f013618052bdf324e0751059c9d00ff87 (diff) |
emacs-lisp/package.el (package-reinstall): Accept package-desc objects.
-rw-r--r-- | lisp/ChangeLog | 1 | ||||
-rw-r--r-- | lisp/emacs-lisp/package.el | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 375304bff9..fbf77c6258 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -7,6 +7,7 @@ selected. When given a package-desc object which is already installed, the package is not downloaded again, but it is marked as selected (if it wasn't already). + (package-reinstall): Accept package-desc objects. 2015-02-03 Artur Malabarba <bruce.connor.am@gmail.com> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 3d44755f46..c635fcdf67 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1265,12 +1265,16 @@ to install it but still mark it as selected." ;;;###autoload (defun package-reinstall (pkg) - "Reinstall package PKG." + "Reinstall package PKG. +PKG shoul be either a symbol, the package name, or a package-desc +object." (interactive (list (intern (completing-read "Reinstall package: " (mapcar #'symbol-name (mapcar #'car package-alist)))))) - (package-delete (cadr (assq pkg package-alist)) 'force 'nosave) + (package-delete + (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist))) + 'force 'nosave) (package-install pkg)) (defun package-strip-rcs-id (str) |