Subject: bug#41436: 26.1; How to list upgradable packages only

From: Marcin Włodarczak <[email-masked]>
Date: Sun, 23 Aug 2020 18:16:00 +0200

Eduardo Mercovich <[email-masked]> writes:

>
> Upon refreshing the repos, the emacs package manager (PM) tells us
> if/how many packages we have to upgrade. With U we can mark them all,
> and with X let the PM do it's job (uninstall old versions, install the
> new ones). Up to here, everything is great.
>
> However, being a rookie, I' afraid of upgrading 28 packages at once
> since some things may break, so I prefer to upgrade them in small groups
> in a more controlled way. 
>
> But, for my life, even after quite some searching and reading I can't
> find how to filter the list by that status (the command
> package-menu-filter does something different or I don't understand how
> to use it for this), so I can see only the packages that can be
> upgraded. With that list in front of me, I can pick which ones to
> upgrade, slowly and in a more controlled path.

I too think such a feature would be useful. The following would get us
part of the way but it has two problems:

1. It lists both the installed packages and the upgrade candidates.
2. As far as I can see, there is no mechanism for marking individual
packages for upgrading.

As a matter of fact, I think an even more general filtering mechanism
would be useful, which would allow us to show, say, all installed
packages or all dependencies, etc. but it does indeed seem that at the
moment only keyword filtering is supported. I could try to add it if
people think this makes sense.

(defun package-menu-show-upgradable ()
  (interactive)
  (let ((upgrades (mapcar 'car (package-menu--find-upgrades))))
    (package-show-package-list upgrades)))