mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-28 07:45:00 +00:00
* lisp/emacs-lisp/package.el: Always update selected-packages
(package--update-selected-packages): New function. (package-menu-execute): Use it before starting the transaction, this way the list of selected packages is updated even when the transaction fails. (package-menu--perform-transaction): Don't edit selected-packages.
This commit is contained in:
parent
1f83c3e524
commit
7ac84a2570
@ -2954,9 +2954,24 @@ objects removed."
|
||||
(dolist (elt (package--sort-by-dependence delete-list))
|
||||
(condition-case-unless-debug err
|
||||
(let ((inhibit-message t))
|
||||
(package-delete elt))
|
||||
(package-delete elt nil 'nosave))
|
||||
(error (message (cadr err))))))))
|
||||
|
||||
(defun package--update-selected-packages (add remove)
|
||||
"Update the `package-selected-packages' list according to ADD and REMOVE.
|
||||
ADD and REMOVE must be disjoint lists of package names (or
|
||||
`package-desc' objects) to be added and removed to the selected
|
||||
packages list, respectively."
|
||||
(dolist (p add)
|
||||
(cl-pushnew (if (package-desc-p p) (package-desc-name p) p)
|
||||
package-selected-packages))
|
||||
(dolist (p remove)
|
||||
(setq package-selected-packages
|
||||
(remove (if (package-desc-p p) (package-desc-name p) p)
|
||||
package-selected-packages)))
|
||||
(when (or add remove)
|
||||
(package--save-selected-packages package-selected-packages)))
|
||||
|
||||
(defun package-menu-execute (&optional noquery)
|
||||
"Perform marked Package Menu actions.
|
||||
Packages marked for installation are downloaded and installed;
|
||||
@ -2993,10 +3008,7 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm."
|
||||
"]")))
|
||||
(message (replace-regexp-in-string "__" "ing" message-template) "started")
|
||||
;; Packages being upgraded are not marked as selected.
|
||||
(when .install
|
||||
(dolist (p .install)
|
||||
(cl-pushnew (package-desc-name p) package-selected-packages))
|
||||
(package--save-selected-packages package-selected-packages))
|
||||
(package--update-selected-packages .install .delete)
|
||||
(package-menu--perform-transaction install-list delete-list)
|
||||
(when package-selected-packages
|
||||
(if-let ((removable (package--removable-packages)))
|
||||
|
Loading…
Reference in New Issue
Block a user