28.0.50; tabulated-list-print (with non-nil UPDATE argument) doesn't clean up excess entries

DoneSubmitted by Shitikanth.
Details
2 participants
  • Lars Ingebrigtsen
  • Shitikanth
Owner
unassigned
Severity
normal
S
S
Shitikanth wrote on 24 Aug 20:55 +0200
(address . bug-gnu-emacs@gnu.org)
CALjXJSTnjJeoNLzLDT_ePEqNQPT_sXMhsAT71BtzYWdDrDCWMA@mail.gmail.com
(tabulated-list-print nil t) does not seem to clean up excess remainingentries/lines if the number of tabulated-list-entries has decreased.
Demo: (defun demo-generate-entries (n) (mapcar (lambda (i) (list i (vector (format "title %s" i)))) (number-sequence 1 n)))
(let ((buf (get-buffer-create "*demo*"))) (with-current-buffer buf (tabulated-list-mode) (setq tabulated-list-format '[("title" 70 t)]) (setq tabulated-list-sort-key '("title")) (setq tabulated-list-entries (demo-generate-entries 8)) (tabulated-list-print) (pop-to-buffer buf) (setq tabulated-list-entries (demo-generate-entries 4)) (tabulated-list-print nil t) ))
Expected behaviour:At the end, *demo* buffer should show only 4 entries.
Observed behaviour:*demo* buffer still holds 8 entries, still showing 4 entries that arenow removed from tabulated-list-entries.
S
S
Shitikanth wrote on 24 Aug 21:13 +0200
(address . 50194@debbugs.gnu.org)
CALjXJSRs-2v+xhLQmMGs2HZD=efmFtX1GBmSpz1E4BGpMkEMHw@mail.gmail.com
Proposed fix.
On Wed, 25 Aug 2021 at 00:26, Shitikanth <shitikanth1@gmail.com> wrote:
Toggle quote (31 lines)>> (tabulated-list-print nil t) does not seem to clean up excess remaining> entries/lines if the number of tabulated-list-entries has decreased.>> Demo:> (defun demo-generate-entries (n)> (mapcar (lambda (i)> (list i (vector (format "title %s" i))))> (number-sequence 1 n)))>> (let ((buf (get-buffer-create "*demo*")))> (with-current-buffer buf> (tabulated-list-mode)> (setq tabulated-list-format '[("title" 70 t)])> (setq tabulated-list-sort-key '("title"))> (setq tabulated-list-entries (demo-generate-entries 8))> (tabulated-list-print)> (pop-to-buffer buf)> (setq tabulated-list-entries (demo-generate-entries 4))> (tabulated-list-print nil t)> ))>> Expected behaviour:> At the end, *demo* buffer should show only 4 entries.>> Observed behaviour:> *demo* buffer still holds 8 entries, still showing 4 entries that are> now removed from tabulated-list-entries.>>>
L
L
Lars Ingebrigtsen wrote on 25 Aug 13:35 +0200
(name . Shitikanth)(address . shitikanth1@gmail.com)(address . 50194@debbugs.gnu.org)
874kbdlpug.fsf@gnus.org
Shitikanth <shitikanth1@gmail.com> writes:
Toggle quote (2 lines)> Proposed fix.
Makes sense to me; applied to Emacs 28.
This change was small enough to apply without assigning copyright to theFSF, but for future patches you want to submit, it might make sense toget the paperwork started now, so that subsequent patches can be appliedspeedily. Would you be willing to sign such paperwork?
-- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no
L
L
Lars Ingebrigtsen wrote on 25 Aug 13:35 +0200
control message for bug #50194
(address . control@debbugs.gnu.org)
8735qxlpu8.fsf@gnus.org
close 50194 28.1quit
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send email to 50194@debbugs.gnu.org