[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#21625: closed ([PATCH] lisp/emacs-lisp/package.el

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#21625: closed ([PATCH] lisp/emacs-lisp/package.el (package-install): Fix error.)
Date: Tue, 06 Oct 2015 18:44:02 +0000

Your message dated Tue, 6 Oct 2015 19:43:01 +0100
with message-id <address@hidden>
and subject line Re: bug#21625: [PATCH] lisp/emacs-lisp/package.el 
(package-install): Fix error.
has caused the debbugs.gnu.org bug report #21625,
regarding [PATCH] lisp/emacs-lisp/package.el (package-install): Fix error.
to be marked as done.

(If you believe you have received this mail in error, please contact

21625: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21625
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] lisp/emacs-lisp/package.el (package-install): Fix error. Date: Mon, 5 Oct 2015 20:55:58 +0100
* lisp/emacs-lisp/package.el (package-install): Fix error when ‘pkg’ is
  not a ‘package-desc’.  Also clarify documentation.

Through trial and error, I discovered that for non-interactive use the
‘pkg’ argument of the package-install function should be a symbol, not a
string.  This can also be discerned by inspecting the (interactive)
spec, specifically the call to ‘intern’.  However, even when proceeding
with a symbol an error is raised if the package is already installed.
This patch reuses the name computed earlier in the function to avoid
 lisp/emacs-lisp/package.el | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index eb66e8f..89f2a1a 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."
 (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."
     (unless (or dont-select (package--user-selected-p name))
-       (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.

--- End Message ---
--- Begin Message --- Subject: Re: bug#21625: [PATCH] lisp/emacs-lisp/package.el (package-install): Fix error. Date: Tue, 6 Oct 2015 19:43:01 +0100
Patch applied. Thanks again Aaron

2015-10-06 13:01 GMT+01:00 Aaron Ecay <address@hidden>:
> Hi Artur,
> Thanks for taking a look at the patch.  My copyright papers are done and
> on file.
> --
> Aaron Ecay

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]