GNU bug report logs - #53133
28.0.90; tabulated-list-sort doesn't work as expected

Previous Next

Package: emacs;

Reported by: Shingo Tanaka <shingo.fg8 <at> gmail.com>

Date: Sun, 9 Jan 2022 02:04:01 UTC

Severity: normal

Tags: confirmed, fixed

Merged with 48639

Found in versions 28.0.50, 28.0.90

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53133 in the body.
You can then email your comments to 53133 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#53133; Package emacs. (Sun, 09 Jan 2022 02:04:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Shingo Tanaka <shingo.fg8 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 09 Jan 2022 02:04:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Shingo Tanaka <shingo.fg8 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.90; tabulated-list-sort doesn't work as expected
Date: Sun, 09 Jan 2022 11:03:27 +0900
Hi,

tabulated-list-sort sometimes doesn't work as expected due to the change between
28.0.90 and 28.0.50.

Here is how to reproduce:
1. Open Emacs from terminal with `emacs --no-init-file'
2. Type M-x list-buffers
3. Type C-x o (go to Buffer Menu)
4. Type C-M-Right 5 times to move on to "Fundamental" in "Mode" column
5. Type S 2 times or more to toggle sorting order
6. You will be able to see that "Size" column is selected as the sorting column
   unexpectedly

Looks like below change from 28.0.50 is releated to this issue, because it
disappears when I just rewind this change.

--- tabulated-list.el.org	2022-01-06 22:32:13.936852142 +0900
+++ tabulated-list.el	2022-01-07 15:15:42.000000000 +0900
@@ -574,7 +581,8 @@
       (when not-last-col
         (when (> pad-right 0) (insert (make-string pad-right ?\s)))
         (insert (propertize
-                 (make-string (- width (min width label-width)) ?\s)
+                 ;; We need at least one space to align correctly.
+                 (make-string (- width (min 1 width label-width)) ?\s)
                  'display `(space :align-to ,next-x))))
       (put-text-property opoint (point) 'tabulated-list-column-name name)
       next-x)))

Hope this will be fixed appropriately in the coming major release.

Regards,
Shingo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53133; Package emacs. (Sun, 09 Jan 2022 10:45:01 GMT) Full text and rfc822 format available.

Message #8 received at 53133 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Shingo Tanaka <shingo.fg8 <at> gmail.com>,
 Stefan Kangas <stefankangas <at> gmail.com>
Cc: 53133 <at> debbugs.gnu.org
Subject: Re: bug#53133: 28.0.90; tabulated-list-sort doesn't work as expected
Date: Sun, 09 Jan 2022 12:44:15 +0200
unarchive 48639
reopen 48639
thanks

> Date: Sun, 09 Jan 2022 11:03:27 +0900
> From: Shingo Tanaka <shingo.fg8 <at> gmail.com>
> 
> Here is how to reproduce:
> 1. Open Emacs from terminal with `emacs --no-init-file'
> 2. Type M-x list-buffers
> 3. Type C-x o (go to Buffer Menu)
> 4. Type C-M-Right 5 times to move on to "Fundamental" in "Mode" column
> 5. Type S 2 times or more to toggle sorting order
> 6. You will be able to see that "Size" column is selected as the sorting column
>    unexpectedly
> 
> Looks like below change from 28.0.50 is releated to this issue, because it
> disappears when I just rewind this change.
> 
> --- tabulated-list.el.org	2022-01-06 22:32:13.936852142 +0900
> +++ tabulated-list.el	2022-01-07 15:15:42.000000000 +0900
> @@ -574,7 +581,8 @@
>        (when not-last-col
>          (when (> pad-right 0) (insert (make-string pad-right ?\s)))
>          (insert (propertize
> -                 (make-string (- width (min width label-width)) ?\s)
> +                 ;; We need at least one space to align correctly.
> +                 (make-string (- width (min 1 width label-width)) ?\s)
>                   'display `(space :align-to ,next-x))))
>        (put-text-property opoint (point) 'tabulated-list-column-name name)
>        next-x)))

You are right.

Stefan, I reverted that change and I'm reopening bug#48639.  This
problem is a much more serious regression than what happens sometimes
when text-size is scaled.  We will need to find another fix for that
bug, most probably in one of the hooks used by tabulated-list.el, by
adding the display property only when actually needed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53133; Package emacs. (Sun, 09 Jan 2022 11:31:02 GMT) Full text and rfc822 format available.

Message #11 received at 53133 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: shingo.fg8 <at> gmail.com, stefankangas <at> gmail.com
Cc: 53133 <at> debbugs.gnu.org
Subject: Re: bug#53133: 28.0.90; tabulated-list-sort doesn't work as expected
Date: Sun, 09 Jan 2022 13:30:28 +0200
> Date: Sun, 09 Jan 2022 12:44:15 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 53133 <at> debbugs.gnu.org
> 
> > --- tabulated-list.el.org	2022-01-06 22:32:13.936852142 +0900
> > +++ tabulated-list.el	2022-01-07 15:15:42.000000000 +0900
> > @@ -574,7 +581,8 @@
> >        (when not-last-col
> >          (when (> pad-right 0) (insert (make-string pad-right ?\s)))
> >          (insert (propertize
> > -                 (make-string (- width (min width label-width)) ?\s)
> > +                 ;; We need at least one space to align correctly.
> > +                 (make-string (- width (min 1 width label-width)) ?\s)
> >                   'display `(space :align-to ,next-x))))
> >        (put-text-property opoint (point) 'tabulated-list-column-name name)
> >        next-x)))
> 
> You are right.
> 
> Stefan, I reverted that change and I'm reopening bug#48639.  This
> problem is a much more serious regression than what happens sometimes
> when text-size is scaled.  We will need to find another fix for that
> bug, most probably in one of the hooks used by tabulated-list.el, by
> adding the display property only when actually needed.

To help debugging the original problem: the 'display' property that
was always present caused move-to-column in tabulated-list-print to
stop at the wrong position, where the tabulated-list-column-name
property had the wrong value.  So either the 'display' property should
be used only when actually needed, or the tabulated-list-column-name
property should be also put on the text covered by the 'display'
property.




Forcibly Merged 48639 53133. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Mon, 10 Jan 2022 01:07:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53133; Package emacs. (Wed, 06 Sep 2023 01:58:02 GMT) Full text and rfc822 format available.

Message #16 received at 53133 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 53133 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 48639-done <at> debbugs.gnu.org, bugs <at> gnu.support
Subject: Re: bug#53133: 28.0.90; tabulated-list-sort doesn't work as expected
Date: Tue, 5 Sep 2023 18:57:26 -0700
> Indeed, that was the root cause of this.  This bug is now fixed on
> master (commit 2767c89db7).

This bug was accidentally left open, so I'm closing it now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 04 Oct 2023 11:24:19 GMT) Full text and rfc822 format available.

This bug report was last modified 204 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.