Subject: bug#63785: 29.0.91; Clearing package list filters also clears flags

From: Robert Pluim <[email-masked]>
Date: Mon, 29 May 2023 19:04:27 +0200

>>>>> On Mon, 29 May 2023 19:48:45 +0300, Eshel Yaron <[email-masked]> said:

    Eshel> Robert Pluim <[email-masked]> writes:
    >> M-x list-packages
    >> / n ack ;; navigate to the line for 'ack'
    >> i ;; 'ack' has the 'I' flag
    >> / / ;; 'ack' no longer has the I flag
    >> 
    >> This makes it harder to do 'search for foo, mark,
    >> search for bar, mark, install', you have to remember to execute the
    >> action after each mark command.
    >> 

    Eshel> That's an interesting issue, it can be a bit tricky because while
    Eshel> filtering for "bar", "foo" is no longer anywhere to be found in the
    Eshel> buffer.  So AFAIU to solve this Emacs needs to maintain something like a
    Eshel> buffer-local association between list entry (package) ids and the tags
    Eshel> they were given.

    Eshel> This sounds like something that applies more broadly to other
    Eshel> `tabulated-list-mode` derivatives as well.  The attached patch adds a
    Eshel> `tabulated-list-maintain-tags` variable and enables it in
    Eshel> `package-menu-mode`.  With it I can search and mark foo, then search and
    Eshel> mark bar, and then install both, as you say.  WDYT?

Itʼs close. The following is still suprising

/ n helm
i
/ /
/ n ack
i
x

That only offer to installs ack, even though Iʼve marked helm. If I
clear the filters then 'x' offers to install both. Although I could
argue that Iʼm in a filtered state, so offering to install only
visible packages is normal :-)

Robert
--