From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Toru TSUNEYOSHI" Newsgroups: gmane.emacs.bugs Subject: Re: patch for dired-format-columns-of-files Date: Thu, 1 May 2008 23:35:05 +0900 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1209684174 17581 80.91.229.12 (1 May 2008 23:22:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 May 2008 23:22:54 +0000 (UTC) To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 02 01:23:30 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jri7b-0006k5-9O for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 May 2008 01:23:27 +0200 Original-Received: from localhost ([127.0.0.1]:51582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jri6u-000812-4P for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 May 2008 19:22:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JrZsQ-0005k2-L4 for bug-gnu-emacs@gnu.org; Thu, 01 May 2008 10:35:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JrZsO-0005ip-VC for bug-gnu-emacs@gnu.org; Thu, 01 May 2008 10:35:14 -0400 Original-Received: from [199.232.76.173] (port=46584 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JrZsO-0005il-Hz for bug-gnu-emacs@gnu.org; Thu, 01 May 2008 10:35:12 -0400 Original-Received: from bay0-omc2-s20.bay0.hotmail.com ([65.54.246.156]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JrZsO-0005LR-0p for bug-gnu-emacs@gnu.org; Thu, 01 May 2008 10:35:12 -0400 Original-Received: from hotmail.com ([207.46.10.20]) by bay0-omc2-s20.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 1 May 2008 07:35:11 -0700 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 1 May 2008 07:35:10 -0700 Original-Received: from 124.155.30.210 by BAY121-DAV10.phx.gbl with DAV; Thu, 01 May 2008 14:35:06 +0000 X-Originating-IP: [124.155.30.210] X-Originating-Email: [t_tuneyosi@hotmail.com] X-Sender: t_tuneyosi@hotmail.com X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 X-OriginalArrivalTime: 01 May 2008 14:35:10.0869 (UTC) FILETIME=[8F5D3C50:01C8AB98] X-detected-kernel: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-Mailman-Approved-At: Thu, 01 May 2008 19:22:07 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17909 Archived-At: (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" To: 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)