unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17219: 24.3.50; wrong alignment when a list is given to dired
@ 2014-04-07 17:35 Nicolas Richard
  2019-08-15  0:03 ` Lars Ingebrigtsen
  2024-12-22 21:08 ` Jakub Ječmínek via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 7+ messages in thread
From: Nicolas Richard @ 2014-04-07 17:35 UTC (permalink / raw)
  To: 17219

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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#17219: 24.3.50; wrong alignment when a list is given to dired
  2014-04-07 17:35 bug#17219: 24.3.50; wrong alignment when a list is given to dired Nicolas Richard
@ 2019-08-15  0:03 ` Lars Ingebrigtsen
  2019-09-19 16:18   ` Nicolas Richard via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-12-22 21:08 ` Jakub Ječmínek via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-15  0:03 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 17219

Nicolas Richard <theonewiththeevillook@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#17219: 24.3.50; wrong alignment when a list is given to dired
  2019-08-15  0:03 ` Lars Ingebrigtsen
@ 2019-09-19 16:18   ` Nicolas Richard via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-09-20  6:28     ` Eli Zaretskii
  2019-09-20 12:48     ` Lars Ingebrigtsen
  0 siblings, 2 replies; 7+ messages in thread
From: Nicolas Richard via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2019-09-19 16:18 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 17219

On 15/08/19 02:03, Lars Ingebrigtsen wrote:
> Nicolas Richard <theonewiththeevillook@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#17219: 24.3.50; wrong alignment when a list is given to dired
  2019-09-19 16:18   ` Nicolas Richard via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2019-09-20  6:28     ` Eli Zaretskii
  2019-09-20 12:48     ` Lars Ingebrigtsen
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2019-09-20  6:28 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: larsi, 17219

> Date: Thu, 19 Sep 2019 18:18:51 +0200
> Cc: 17219@debbugs.gnu.org
> From: Nicolas Richard via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> On 15/08/19 02:03, Lars Ingebrigtsen wrote:
> > Nicolas Richard <theonewiththeevillook@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#17219: 24.3.50; wrong alignment when a list is given to dired
  2019-09-19 16:18   ` Nicolas Richard via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-09-20  6:28     ` Eli Zaretskii
@ 2019-09-20 12:48     ` Lars Ingebrigtsen
  1 sibling, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-20 12:48 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 17219

Nicolas Richard <theonewiththeevillook@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@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#17219: 24.3.50; wrong alignment when a list is given to dired
  2014-04-07 17:35 bug#17219: 24.3.50; wrong alignment when a list is given to dired Nicolas Richard
  2019-08-15  0:03 ` Lars Ingebrigtsen
@ 2024-12-22 21:08 ` Jakub Ječmínek via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-12-23  0:25   ` Charalampos Mitrodimas
  1 sibling, 1 reply; 7+ messages in thread
From: Jakub Ječmínek via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-12-22 21:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Nicolas Richard, 17219

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@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







^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#17219: 24.3.50; wrong alignment when a list is given to dired
  2024-12-22 21:08 ` Jakub Ječmínek via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-23  0:25   ` Charalampos Mitrodimas
  0 siblings, 0 replies; 7+ messages in thread
From: Charalampos Mitrodimas @ 2024-12-23  0:25 UTC (permalink / raw)
  To: Jakub Ječmínek, Eli Zaretskii; +Cc: Nicolas Richard, 17219

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@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






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-12-23  0:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-07 17:35 bug#17219: 24.3.50; wrong alignment when a list is given to dired Nicolas Richard
2019-08-15  0:03 ` Lars Ingebrigtsen
2019-09-19 16:18   ` Nicolas Richard via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-09-20  6:28     ` Eli Zaretskii
2019-09-20 12:48     ` Lars Ingebrigtsen
2024-12-22 21:08 ` Jakub Ječmínek via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-23  0:25   ` Charalampos Mitrodimas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).