From 102a21d68976ab9dc85304e0bc47b7562d3cf93f Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 4 Feb 2015 15:17:06 +0000 Subject: emacs-lisp/package.el (package-reinstall): Accept package-desc objects. --- lisp/ChangeLog | 1 + 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 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) -- cgit v1.2.3