bug#81213: 31.0.90; Package list is colorized after upgrading packages

Philip Kaludercic <[email protected]> Sun, 02 Aug 2026 16:06:49 +0000
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
I thought it might be worthwhile to engage El=C3=ADas in the discussion,
since he implemented the overlay feature.

Philip Kaludercic <[email protected]> writes:

> Sean Whitton <[email protected]> writes:
>
>> Joost Kremers [10/Jun  9:12am +02] wrote:
>>> I do `M-x list-packages`, then `/u` to show upgradable packages, then `=
x`
>>> to install them, packages that are to be installed get a green backgrou=
nd,
>>> packages that are to be deleted a red background. After the installation
>>> finishes, the full list of packages is shown again, but the background
>>> colors remain, with the top half of the buffer in green, the bottom hal=
f in
>>> red. (I'm not sure if it's exactly 50-50, but thereabout, I reckon).
>
> I took a look at this a few weeks back, and it wasn't 50-50.  It is more
> or less random depending on what packages you were upgrading or
> uninstalling, as the underlying issue=20
>
> The easiest fix would be just to remove the overlays when performing the
> upgrade (untested!):
>
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index 062659fc912..b3eca216ae1 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -4068,6 +4070,7 @@ package-menu--partition-transaction
>  (defun package-menu--perform-transaction (install-list delete-list)
>    "Install packages in INSTALL-LIST and delete DELETE-LIST.
>  Return nil if there were no errors; non-nil otherwise."
> +  (remove-overlays (point-min) (point-max) 'pkg-menu-ov t)
>    (let ((errors nil))
>      (if install-list
>          (let ((status-format (format ":Installing %%d/%d"
>
>
> Can you apply this locally and see if it makes a difference in your usage?
>
>>>
>>> I don't really understand the purpose of highlighting installable and
>>> deleteable packages this way, because the highlighting is only applied
>>> after pressing `x`. I assume they get highlighted when one presses `U`,=
 but
>>> I never use that (I prefer `/u`).
>
> What I did not get about your bug report is if you upgrade packages
> manually, or if you filter the packages using "/ u" and then select the
> packages by hand using "I" and "D" (or equivalently "U") _or_ if you
> upgrade the packages one-by-one.
>
>>> At the very least, the highlighting should be removed again after the
>>> packages have been upgraded.
>>
>> Thanks.  Adding Philip.