diff options
| -rw-r--r-- | lisp/ChangeLog | 1 | ||||
| -rw-r--r-- | lisp/dired.el | 28 |
2 files changed, 4 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6405f47dece..1177b89449a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | * dired.el (dired-read-dir-and-switches): | 6 | * dired.el (dired-read-dir-and-switches): |
| 7 | Set minibuffer-completing-file-name and call substitute-in-file-name. | 7 | Set minibuffer-completing-file-name and call substitute-in-file-name. |
| 8 | (dired-format-columns-of-files): Use completion--insert-strings. | ||
| 8 | 9 | ||
| 9 | * minibuffer.el (completion-hilit-commonality): Revert last change: | 10 | * minibuffer.el (completion-hilit-commonality): Revert last change: |
| 10 | the leftover code was actually useful. | 11 | the leftover code was actually useful. |
diff --git a/lisp/dired.el b/lisp/dired.el index a2f0f009d33..51dc58167b5 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -2708,31 +2708,9 @@ just the current file." | |||
| 2708 | (apply function args)))) | 2708 | (apply function args)))) |
| 2709 | 2709 | ||
| 2710 | (defun dired-format-columns-of-files (files) | 2710 | (defun dired-format-columns-of-files (files) |
| 2711 | ;; Files should be in forward order for this loop. | 2711 | (let ((beg (point))) |
| 2712 | ;; i.e., (car files) = first file in buffer. | 2712 | (completion--insert-strings files) |
| 2713 | ;; Returns the number of lines used. | 2713 | (put-text-property beg (point) 'mouse-face nil))) |
| 2714 | (let* ((maxlen (+ 2 (apply 'max (mapcar 'length files)))) | ||
| 2715 | (width (- (window-width (selected-window)) 2)) | ||
| 2716 | (columns (max 1 (/ width maxlen))) | ||
| 2717 | (nfiles (length files)) | ||
| 2718 | (rows (+ (/ nfiles columns) | ||
| 2719 | (if (zerop (% nfiles columns)) 0 1))) | ||
| 2720 | (i 0) | ||
| 2721 | (j 0)) | ||
| 2722 | (setq files (nconc (copy-sequence files) ; fill up with empty fns | ||
| 2723 | (make-list (- (* columns rows) nfiles) ""))) | ||
| 2724 | (setcdr (nthcdr (1- (length files)) files) files) ; make circular | ||
| 2725 | (while (< j rows) | ||
| 2726 | (while (< i columns) | ||
| 2727 | (indent-to (* i maxlen)) | ||
| 2728 | (insert (car files)) | ||
| 2729 | (setq files (nthcdr rows files) | ||
| 2730 | i (1+ i))) | ||
| 2731 | (insert "\n") | ||
| 2732 | (setq i 0 | ||
| 2733 | j (1+ j) | ||
| 2734 | files (cdr files))) | ||
| 2735 | rows)) | ||
| 2736 | 2714 | ||
| 2737 | ;; Commands to mark or flag file(s) at or near current line. | 2715 | ;; Commands to mark or flag file(s) at or near current line. |
| 2738 | 2716 | ||