[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: patch for dired-format-columns-of-files
From: |
Toru TSUNEYOSHI |
Subject: |
Re: patch for dired-format-columns-of-files |
Date: |
Thu, 1 May 2008 23:35:05 +0900 |
(Sorry, I didn't write about the bug as I thought it is clear that what
is it. But, I should have written it.
In accordance with auto reply e-mail, I have already sent to
171@emacsbugs.donarmstrong.com. But just to make sure, I will send to
bug-gnu-emacs@gnu.org again.)
For example, I find the bug after I do (dired-do-flagged-delete), if
`FILES' list includes Japanse file name. The bug is that each file name
doesn't separate properly in "*Deletions*" buffer.
Because (dired-format-columns-of-files) uses `length' function not
`string-width' function. So, I corrected it.
example:
d:/test:
total used in directory 0 available 1024
drwxrwxrwx 1 user root 0 05-01 12:22 .
drwxrwxrwx 1 user root 0 1970-01-01 ..
D -rw-rw-rw- 1 user root 0 05-01 12:22 test.txt
D -rw-rw-rw- 1 user root 0 05-01 12:22 テスト.txt
D -rw-rw-rw- 1 user root 0 05-01 12:22 テスト2.txt
D -rw-rw-rw- 1 user root 0 05-01 12:22 テスト3.txt
(dired-do-flagged-delete)
=> (in "*Deletions*" buffer)
test.txt テスト.txtテスト2.txtテスト3.txt
----- Original Message -----
From: "Toru TSUNEYOSHI" <t_tuneyosi@hotmail.com>
To: <bug-gnu-emacs@gnu.org>
Sent: Thursday, May 01, 2008 2:50 AM
Subject: patch for dired-format-columns-of-files
> I found a bug when I do (dired-do-delete).
> I will send the patch for correcting it.
>
> --- lisp/dired.el.orig 2008-03-17 01:27:10.000000000 +0900
> +++ lisp/dired.el 2008-05-01 02:33:21.297046400 +0900
> @@ -2639,9 +2639,9 @@
> (defun dired-format-columns-of-files (files)
> ;; Files should be in forward order for this loop.
> ;; i.e., (car files) = first file in buffer.
> ;; Returns the number of lines used.
> - (let* ((maxlen (+ 2 (apply 'max (mapcar 'length files))))
> + (let* ((maxlen (+ 2 (apply 'max (mapcar 'string-width files))))
> (width (- (window-width (selected-window)) 2))
> (columns (max 1 (/ width maxlen)))
> (nfiles (length files))
> (rows (+ (/ nfiles columns)
- Re: patch for dired-format-columns-of-files,
Toru TSUNEYOSHI <=