GNU bug report logs - #17219
24.3.50; wrong alignment when a list is given to dired

Previous Next

Package: emacs;

Reported by: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>

Date: Mon, 7 Apr 2014 17:37:01 UTC

Severity: normal

Tags: confirmed

Found in version 24.3.50

Done: Eli Zaretskii <eliz <at> gnu.org>

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 17219 in the body.
You can then email your comments to 17219 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#17219; Package emacs. (Mon, 07 Apr 2014 17:37:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Richard <theonewiththeevillook <at> yahoo.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 07 Apr 2014 17:37:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; wrong alignment when a list is given to dired
Date: Mon, 07 Apr 2014 19:35:43 +0200
Steps to reproduce :

emacs -Q
M-: (dired (list "Something" "/" "~/"))

this gives, on my system:
: /home/youngfrog/mesnotes/lisp:
: drwxr-xr-x 22 root root 4096 mar 15 20:53 /
: drwxr-xr-x 128 youngfrog youngfrog 12288 avr  7 18:23 /home/youngfrog/

which is not properly aligned.

OTOH, doing
M-: (dired (list "Something" "~/" "/" "/usr" ))

gives:
: drwxr-xr-x 128 youngfrog youngfrog 12288 avr  7 18:23 /home/youngfrog/
: drwxr-xr-x  22 root      root       4096 mar 15 20:53 /
: drwxr-xr-x  10 root      root       4096 nov  9  2012 /usr

which is ok wrt alignment.

It's dired-align-file that apparently can not do its work in the first
situation. Not sure if this can be fixed easily. From the comments, the
condition (> other-col file-col) seems important in the current
implementation.

Opinions ?

In GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.20)
 of 2014-01-30 on LDLC-portable
Windowing system distributor `The X.Org Foundation', version 11.0.11405000
System Description:	Ubuntu 13.10

Configured using:
 `configure 'CFLAGS=-g3 -O2''

Important settings:
  value of $LANG: fr_BE.UTF-8
  locale-coding-system: utf-8-unix

-- 
Nico.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17219; Package emacs. (Thu, 15 Aug 2019 00:04:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: 17219 <at> debbugs.gnu.org
Subject: Re: bug#17219: 24.3.50; wrong alignment when a list is given to dired
Date: Wed, 14 Aug 2019 17:03:51 -0700
Nicolas Richard <theonewiththeevillook <at> yahoo.fr> writes:

> Steps to reproduce :
>
> emacs -Q
> M-: (dired (list "Something" "/" "~/"))
>
> this gives, on my system:
> : /home/youngfrog/mesnotes/lisp:
> : drwxr-xr-x 22 root root 4096 mar 15 20:53 /
> : drwxr-xr-x 128 youngfrog youngfrog 12288 avr  7 18:23 /home/youngfrog/
>
> which is not properly aligned.

(I'm going through old bug reports that have unfortunately gotten no
responses yet.)

I tried this in Emacs 27, and I was unable to reproduce the problem.
Are you still seeing this?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 15 Aug 2019 00:05:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17219; Package emacs. (Thu, 19 Sep 2019 16:20:01 GMT) Full text and rfc822 format available.

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

From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 17219 <at> debbugs.gnu.org
Subject: Re: bug#17219: 24.3.50; wrong alignment when a list is given to dired
Date: Thu, 19 Sep 2019 18:18:51 +0200
On 15/08/19 02:03, Lars Ingebrigtsen wrote:
> Nicolas Richard <theonewiththeevillook <at> yahoo.fr> writes:
>> Steps to reproduce :
>>
>> emacs -Q
>> M-: (dired (list "Something" "/" "~/"))
>>
>> this gives, on my system:
>> : /home/youngfrog/mesnotes/lisp:
>> : drwxr-xr-x 22 root root 4096 mar 15 20:53 /
>> : drwxr-xr-x 128 youngfrog youngfrog 12288 avr  7 18:23 /home/youngfrog/
>>
>> which is not properly aligned.
> 
> (I'm going through old bug reports that have unfortunately gotten no
> responses yet.)
> 
> I tried this in Emacs 27, and I was unable to reproduce the problem.
> Are you still seeing this?

Hi Lars,

Thanks for your patience. I still misalignement if I hit 'g'
(revert-buffer) afterwards.

I can be more precise if you wish.

Nicolas.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17219; Package emacs. (Thu, 19 Sep 2019 16:20:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17219; Package emacs. (Fri, 20 Sep 2019 06:29:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: larsi <at> gnus.org, 17219 <at> debbugs.gnu.org
Subject: Re: bug#17219: 24.3.50; wrong alignment when a list is given to dired
Date: Fri, 20 Sep 2019 09:28:10 +0300
> Date: Thu, 19 Sep 2019 18:18:51 +0200
> Cc: 17219 <at> debbugs.gnu.org
> From: Nicolas Richard via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> On 15/08/19 02:03, Lars Ingebrigtsen wrote:
> > Nicolas Richard <theonewiththeevillook <at> yahoo.fr> writes:
> >> Steps to reproduce :
> >>
> >> emacs -Q
> >> M-: (dired (list "Something" "/" "~/"))
> >>
> >> this gives, on my system:
> >> : /home/youngfrog/mesnotes/lisp:
> >> : drwxr-xr-x 22 root root 4096 mar 15 20:53 /
> >> : drwxr-xr-x 128 youngfrog youngfrog 12288 avr  7 18:23 /home/youngfrog/
> >>
> >> which is not properly aligned.
> > 
> > (I'm going through old bug reports that have unfortunately gotten no
> > responses yet.)
> > 
> > I tried this in Emacs 27, and I was unable to reproduce the problem.
> > Are you still seeing this?
> 
> Hi Lars,
> 
> Thanks for your patience. I still misalignement if I hit 'g'
> (revert-buffer) afterwards.

I guess it's because there are only 2 lines in the resulting buffer or
something.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17219; Package emacs. (Fri, 20 Sep 2019 12:50:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: 17219 <at> debbugs.gnu.org
Subject: Re: bug#17219: 24.3.50; wrong alignment when a list is given to dired
Date: Fri, 20 Sep 2019 14:48:59 +0200
Nicolas Richard <theonewiththeevillook <at> yahoo.fr> writes:

>>> M-: (dired (list "Something" "/" "~/"))

[...]

> Thanks for your patience. I still misalignement if I hit 'g'
> (revert-buffer) afterwards.

Ah, yes, with `g' I get the misalignment, too.

Eli Zaretskii <eliz <at> gnu.org> writes:

> I guess it's because there are only 2 lines in the resulting buffer or
> something.

I get the same problem with three lines.

(dired (list "Something" "/" "~/" "/tmp"))
=>

  /home/larsi/src/emacs/trunk/lisp/progmodes:
  drwxr-xr-x 26 root root   4.0K Sep 17 13:43 /
  drwxr-xr-x 78 larsi larsi 4.0K Sep 20 14:32 /home/larsi/
  drwxrwxrwt 27 root  root   36K Sep 20 14:41 /tmp

and then `g'

  /home/larsi/src/emacs/trunk/lisp/progmodes:
  drwxr-xr-x 26 root root 4.0K Sep 17 13:43 /
  drwxr-xr-x 78 larsi larsi 4.0K Sep 20 14:32 /home/larsi/
  drwxrwxrwt 27 root  root   36K Sep 20 14:41 /tmp

It seems like the first line always loses the two extra spaces after
"root root".  Or...  experimenting with the order

  /home/larsi/src/emacs/trunk:
  drwxr-xr-x 26 root root 4.0K Sep 17 13:43 /
  drwxrwxrwt 27 root root  36K Sep 20 14:41 /tmp
  drwxr-xr-x 78 larsi larsi 4.0K Sep 20 14:32 /home/larsi/

If the "root" lines are both first, then both lose the alignment.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 20 Sep 2019 12:50:03 GMT) Full text and rfc822 format available.

Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 20 Sep 2019 12:50:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17219; Package emacs. (Sun, 22 Dec 2024 21:10:02 GMT) Full text and rfc822 format available.

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

From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>, 17219 <at> debbugs.gnu.org
Subject: Re: bug#17219: 24.3.50; wrong alignment when a list is given to dired
Date: Sun, 22 Dec 2024 21:08:50 +0000
It seems that adding simple `dired--align-all-files' to the end of
`dired-revert' resolves this.

From 41780fde84fe1c55a0a7417a833dc0b8303a3db8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Je=C4=8Dm=C3=ADnek?= <kuba <at> kubajecminek.cz>
Date: Sun, 22 Dec 2024 21:53:53 +0100
Subject: [PATCH] Align files after dired revert (Bug#17219)

* lisp/dired.el (dired-revert): Add dired--align-all-files
function call.
---
 lisp/dired.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/dired.el b/lisp/dired.el
index 028b862d159..acd31fb6424 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2157,7 +2157,8 @@ dired-revert
 	(if (dired-goto-subdir dir)
 	    (dired-hide-subdir 1))))
     (unless modflag (restore-buffer-modified-p nil))
-    (hack-dir-local-variables-non-file-buffer))
+    (hack-dir-local-variables-non-file-buffer)
+    (dired--align-all-files))
   ;; outside of the let scope
 ;;;  Might as well not override the user if the user changed this.
 ;;;  (setq buffer-read-only t)
-- 
2.45.2






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17219; Package emacs. (Mon, 23 Dec 2024 00:26:02 GMT) Full text and rfc822 format available.

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

From: Charalampos Mitrodimas <charmitro <at> posteo.net>
To: Jakub Ječmínek <kuba <at> kubajecminek.cz>,
 Eli Zaretskii <eliz <at> gnu.org>
Cc: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>, 17219 <at> debbugs.gnu.org
Subject: Re: bug#17219: 24.3.50; wrong alignment when a list is given to dired
Date: Mon, 23 Dec 2024 00:25:26 +0000
Hi Jakub,


On 22/12/24 11:08 PM, Jakub Ječmínek via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> It seems that adding simple `dired--align-all-files' to the end of
> `dired-revert' resolves this.
>
>  From 41780fde84fe1c55a0a7417a833dc0b8303a3db8 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Jakub=20Je=C4=8Dm=C3=ADnek?= <kuba <at> kubajecminek.cz>
> Date: Sun, 22 Dec 2024 21:53:53 +0100
> Subject: [PATCH] Align files after dired revert (Bug#17219)
>
> * lisp/dired.el (dired-revert): Add dired--align-all-files
> function call.
> ---
>   lisp/dired.el | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/dired.el b/lisp/dired.el
> index 028b862d159..acd31fb6424 100644
> --- a/lisp/dired.el
> +++ b/lisp/dired.el
> @@ -2157,7 +2157,8 @@ dired-revert
>   	(if (dired-goto-subdir dir)
>   	    (dired-hide-subdir 1))))
>       (unless modflag (restore-buffer-modified-p nil))
> -    (hack-dir-local-variables-non-file-buffer))
> +    (hack-dir-local-variables-non-file-buffer)
> +    (dired--align-all-files))
What about performance? Depending on the size of the directory, 
recalculating alignment could have a minor performance impact.
>     ;; outside of the let scope
>   ;;;  Might as well not override the user if the user changed this.
>   ;;;  (setq buffer-read-only t)


--
C. Mitrodimas





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17219; Package emacs. (Mon, 23 Dec 2024 17:54:02 GMT) Full text and rfc822 format available.

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

From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
To: Charalampos Mitrodimas <charmitro <at> posteo.net>
Cc: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>,
 Eli Zaretskii <eliz <at> gnu.org>, 17219 <at> debbugs.gnu.org
Subject: Re: bug#17219: 24.3.50; wrong alignment when a list is given to dired
Date: Mon, 23 Dec 2024 17:52:54 +0000
Hello,

"Charalampos Mitrodimas" <charmitro <at> posteo.net> writes:

> What about performance? Depending on the size of the directory,
> recalculating alignment could have a minor performance impact.

There is. The largest directory I have on my machine has around 18k
files (~5GB) and the penalty is around 20ms. I've run the tests for both
functions in standalone Emacs session started using 'emacs -Q'. Below
are the profiling results:

Function Name     Call Count  Elapsed Time  Average Time
--------------------------------------------------------
dired-revert-new  10          5.2096629750  0.5209662975
dired-revert-old  10          5.051716523   0.5051716522

dired-revert-new  25          11.843308944  0.4737323577
dired-revert-old  25          11.391448779  0.4556579511


Please let me know if that's too high so we can find another way.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17219; Package emacs. (Mon, 23 Dec 2024 18:21:01 GMT) Full text and rfc822 format available.

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

From: Charalampos Mitrodimas <charmitro <at> posteo.net>
To: Jakub Ječmínek <kuba <at> kubajecminek.cz>
Cc: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>,
 Eli Zaretskii <eliz <at> gnu.org>, 17219 <at> debbugs.gnu.org
Subject: Re: bug#17219: 24.3.50; wrong alignment when a list is given to dired
Date: Mon, 23 Dec 2024 18:20:23 +0000
Thanks Jakub!

On 12/23/24 19:52, Jakub Ječmínek via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Hello,
>
> "Charalampos Mitrodimas" <charmitro <at> posteo.net> writes:
>
>> What about performance? Depending on the size of the directory,
>> recalculating alignment could have a minor performance impact.
> There is. The largest directory I have on my machine has around 18k
> files (~5GB) and the penalty is around 20ms. I've run the tests for both
> functions in standalone Emacs session started using 'emacs -Q'. Below
> are the profiling results:
>
> Function Name     Call Count  Elapsed Time  Average Time
> --------------------------------------------------------
> dired-revert-new  10          5.2096629750  0.5209662975
> dired-revert-old  10          5.051716523   0.5051716522
>
> dired-revert-new  25          11.843308944  0.4737323577
> dired-revert-old  25          11.391448779  0.4556579511
>
>
> Please let me know if that's too high so we can find another way.
If my math doesn't deceive me, the performance penalty ranges
between 3.13% (10 calls) and 3.97% (25 calls) based on the profiling
results, which I find acceptable.


--
C. Mitrodimas





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17219; Package emacs. (Thu, 16 Jan 2025 21:36:01 GMT) Full text and rfc822 format available.

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

From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>, 17219 <at> debbugs.gnu.org
Subject: Re: bug#17219: 24.3.50; wrong alignment when a list is given to dired
Date: Thu, 16 Jan 2025 21:35:14 +0000
What do you think, should this be merged or should we rework the patch?

"Charalampos Mitrodimas" <charmitro <at> posteo.net> writes:

> Thanks Jakub!
>
> On 12/23/24 19:52, Jakub Ječmínek via Bug reports for GNU Emacs, the
> Swiss army knife of text editors wrote:
>> Hello,
>>
>> "Charalampos Mitrodimas" <charmitro <at> posteo.net> writes:
>>
>>> What about performance? Depending on the size of the directory,
>>> recalculating alignment could have a minor performance impact.
>> There is. The largest directory I have on my machine has around 18k
>> files (~5GB) and the penalty is around 20ms. I've run the tests for both
>> functions in standalone Emacs session started using 'emacs -Q'. Below
>> are the profiling results:
>>
>> Function Name     Call Count  Elapsed Time  Average Time
>> --------------------------------------------------------
>> dired-revert-new  10          5.2096629750  0.5209662975
>> dired-revert-old  10          5.051716523   0.5051716522
>>
>> dired-revert-new  25          11.843308944  0.4737323577
>> dired-revert-old  25          11.391448779  0.4556579511
>>
>>
>> Please let me know if that's too high so we can find another way.
> If my math doesn't deceive me, the performance penalty ranges
> between 3.13% (10 calls) and 3.97% (25 calls) based on the profiling
> results, which I find acceptable.
>
>
> --
> C. Mitrodimas
>





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17219; Package emacs. (Fri, 17 Jan 2025 07:05:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jakub Ječmínek <kuba <at> kubajecminek.cz>
Cc: theonewiththeevillook <at> yahoo.fr, 17219 <at> debbugs.gnu.org
Subject: Re: bug#17219: 24.3.50; wrong alignment when a list is given to dired
Date: Fri, 17 Jan 2025 09:04:13 +0200
> Date: Thu, 16 Jan 2025 21:35:14 +0000
> From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
> Cc: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>, 17219 <at> debbugs.gnu.org
> 
> What do you think, should this be merged or should we rework the patch?

Sorry, I didn't yet have enough time to look into the proposed
patches.  But I didn't forget, either.

At least on my system I saw one other related problem with this
recipe, which isn't an alignment problem at all.  So I think there's
more here than meets the eye, and will look into this when I have
time.

Stay tuned.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sun, 19 Jan 2025 10:24:02 GMT) Full text and rfc822 format available.

Notification sent to Nicolas Richard <theonewiththeevillook <at> yahoo.fr>:
bug acknowledged by developer. (Sun, 19 Jan 2025 10:24:03 GMT) Full text and rfc822 format available.

Message #49 received at 17219-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kuba <at> kubajecminek.cz
Cc: theonewiththeevillook <at> yahoo.fr, 17219-done <at> debbugs.gnu.org
Subject: Re: bug#17219: 24.3.50; wrong alignment when a list is given to dired
Date: Sun, 19 Jan 2025 12:23:35 +0200
> Cc: theonewiththeevillook <at> yahoo.fr, 17219 <at> debbugs.gnu.org
> Date: Fri, 17 Jan 2025 09:04:13 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > Date: Thu, 16 Jan 2025 21:35:14 +0000
> > From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
> > Cc: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>, 17219 <at> debbugs.gnu.org
> > 
> > What do you think, should this be merged or should we rework the patch?
> 
> Sorry, I didn't yet have enough time to look into the proposed
> patches.  But I didn't forget, either.
> 
> At least on my system I saw one other related problem with this
> recipe, which isn't an alignment problem at all.  So I think there's
> more here than meets the eye, and will look into this when I have
> time.
> 
> Stay tuned.

Thanks, I've now installed the patch on the master branch, and I'm
therefore closing this bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 16 Feb 2025 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 83 days ago.

Previous Next


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