Skip to content

Commit

Permalink
Fix new behavior or package-install for emacs-25.
Browse files Browse the repository at this point in the history
The meaning of second arg of package-install have changed since
initial versions using package-selected-packages.

* helm-elisp-package.el (helm-el-package-install-1): No need now
to handle package-selected-packages.
(helm-el-package-upgrade-1): Inverse meaning of 2nd arg.
  • Loading branch information
Thierry Volpiatto committed Jun 13, 2016
1 parent cde81b5 commit 8ec930e
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions helm-elisp-package.el
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,20 @@

(defun helm-el-package-install-1 (pkg-list)
(cl-loop with mkd = pkg-list
for p in mkd
for id = (get-text-property 0 'tabulated-list-id p)
do (package-install
(if (fboundp 'package-desc-name) id (car id)))
collect (if (fboundp 'package-desc-full-name) id (car id))
into installed-list
finally do (progn
(when (boundp 'package-selected-packages)
(customize-save-variable
'package-selected-packages
(append (mapcar 'package-desc-name installed-list)
package-selected-packages)))
(if (fboundp 'package-desc-full-name)
(message (format "%d packages installed:\n(%s)"
(length installed-list)
(mapconcat #'package-desc-full-name
installed-list ", ")))
(message (format "%d packages installed:\n(%s)"
(length installed-list)
(mapconcat 'symbol-name installed-list ", ")))))))
for p in mkd
for id = (get-text-property 0 'tabulated-list-id p)
do (package-install
(if (fboundp 'package-desc-name) id (car id)))
collect (if (fboundp 'package-desc-full-name) id (car id))
into installed-list
finally do (if (fboundp 'package-desc-full-name)
(message (format "%d packages installed:\n(%s)"
(length installed-list)
(mapconcat #'package-desc-full-name
installed-list ", ")))
(message (format "%d packages installed:\n(%s)"
(length installed-list)
(mapconcat 'symbol-name installed-list ", "))))))

(defun helm-el-package-install (_candidate)
(helm-el-package-install-1 (helm-marked-candidates)))
Expand Down Expand Up @@ -213,7 +207,10 @@
(ignore))
((equal pkg-desc upgrade)
;;Install.
(package-install pkg-desc))
(with-no-warnings
(if (boundp 'package-selected-packages)
(package-install pkg-desc t)
(package-install pkg-desc))))
(t
;; Delete.
(if (boundp 'package-selected-packages)
Expand Down Expand Up @@ -386,7 +383,7 @@
;; packages already installed, the name (as symbol)
;; fails with such packages.
(package-install
(cadr (assq name package-archive-contents))))
(cadr (assq name package-archive-contents)) t))
(package-delete pkg-desc)
(package-install name))))

Expand Down

0 comments on commit 8ec930e

Please sign in to comment.