]> git.eshelyaron.com Git - emacs.git/commitdiff
emacs-lisp/package.el: Fix previous patch
authorThierry Volpiatto <thierry.volpiatto@gmail.com>
Mon, 2 Feb 2015 09:24:46 +0000 (10:24 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Mon, 2 Feb 2015 10:15:36 +0000 (10:15 +0000)
lisp/ChangeLog
lisp/emacs-lisp/package.el

index cba38ffb39312ab3ba171c640578004f8ee08906..846da3b0dee64b753f32cb5b973d43186da85ad7 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-02  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
+
+       * emacs-lisp/package.el (package-delete): Remove package from
+       package-selected-packages.
+       (package-autoremove): Remove unneeded variable.
+
 2015-02-01  Artur Malabarba  <bruce.connor.am@gmail.com>
 
        * emacs-lisp/package.el (package-selected-packages): Fix :type
index 3b22962bb2937a740ed82e75a768fb3630450a30..d95bc5e6d73a5e682164954d40c3ee7caf0f6254 100644 (file)
@@ -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))