From: Thierry Volpiatto Date: Mon, 2 Feb 2015 09:24:46 +0000 (+0100) Subject: emacs-lisp/package.el: Fix previous patch X-Git-Tag: emacs-25.0.90~2008^2~147 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=060dc145902f048bed22919232ce0e7b0e22d4b1;p=emacs.git emacs-lisp/package.el: Fix previous patch --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cba38ffb393..846da3b0dee 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-02-02 Thierry Volpiatto + + * emacs-lisp/package.el (package-delete): Remove package from + package-selected-packages. + (package-autoremove): Remove unneeded variable. + 2015-02-01 Artur Malabarba * emacs-lisp/package.el (package-selected-packages): Fix :type diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 3b22962bb29..d95bc5e6d73 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1505,6 +1505,10 @@ elsewhere." (delete pkg-desc pkgs) (unless (cdr pkgs) (setq package-alist (delq pkgs package-alist)))) + ;; Update package-selected-packages. + (when (memq name package-selected-packages) + (customize-save-variable + 'package-selected-packages (remove name package-selected-packages))) (message "Package `%s' deleted." (package-desc-full-name pkg-desc)))))) ;;;###autoload @@ -1515,12 +1519,9 @@ Packages that are no more needed by other packages in `package-selected-packages' and their dependencies will be deleted." (interactive) - (let* (old-direct - (needed (cl-loop for p in package-selected-packages - if (assq p package-alist) - append (package--get-deps p) into lst - else do (push p old-direct) - finally return lst))) + (let ((needed (cl-loop for p in package-selected-packages + if (assq p package-alist) + append (package--get-deps p)))) (cl-loop for p in (mapcar #'car package-alist) unless (or (memq p needed) (memq p package-selected-packages))