bug-gnu-emacs
[Top][All Lists]
Advanced

[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: Sat, 3 May 2008 11:29:29 +0900

Thanks.
This change looks smart.
(I don't know that completion--insert-strings function exists.)

----- Original Message ----- 
From: "Stefan Monnier" <address@hidden>
To: "Toru TSUNEYOSHI" <address@hidden>
Cc: <address@hidden>
Sent: Saturday, May 03, 2008 2:39 AM
Subject: Re: patch for dired-format-columns-of-files


> > (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
> >  address@hidden But just to make sure, I will send to
> >  address@hidden 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.
> 
> Thanks.  I've installed a similar fix to completion--insert-strings and
> made dired use that function.
> 
> 
>         Stefan
> 
> 
> --- dired.el.~1.392.~ 2008-05-02 13:19:10.000000000 -0400
> +++ dired.el 2008-05-02 13:35:06.000000000 -0400
> @@ -2708,31 +2708,9 @@
>        (apply function args))))
>  
>  (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))))
> - (width (- (window-width (selected-window)) 2))
> - (columns (max 1 (/ width maxlen)))
> - (nfiles (length files))
> - (rows (+ (/ nfiles columns)
> -   (if (zerop (% nfiles columns)) 0 1)))
> - (i 0)
> - (j 0))
> -    (setq files (nconc (copy-sequence files) ; fill up with empty fns
> -        (make-list (- (* columns rows) nfiles) "")))
> -    (setcdr (nthcdr (1- (length files)) files) files) ; make circular
> -    (while (< j rows)
> -      (while (< i columns)
> - (indent-to (* i maxlen))
> - (insert (car files))
> - (setq files (nthcdr rows files)
> -       i (1+ i)))
> -      (insert "\n")
> -      (setq i 0
> -     j (1+ j)
> -     files (cdr files)))
> -    rows))
> +  (let ((beg (point)))
> +    (completion--insert-strings files)
> +    (put-text-property pos (point) 'mouse-face nil)))
>   
>  ;; Commands to mark or flag file(s) at or near current line.
>  
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]