all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* change behavior of dired-simultaneous-find-file
@ 2010-06-20  7:33 Thierry Volpiatto
  0 siblings, 0 replies; only message in thread
From: Thierry Volpiatto @ 2010-06-20  7:33 UTC (permalink / raw)
  To: emacs-devel

Hi, when hitting F in dired, if too much files are marked, an error
popup:

,----
| Too many files to visit simultaneously.  Try C-u prefix.
`----


Why instead of that not opening files in background as suggested by this
error message?

So no error message, if window is too small use find-file-noselect else
do what expected, split window.

WDYT?

(defun dired-simultaneous-find-file (file-list noselect)

  "Visit all files in FILE-LIST and display them simultaneously.
The current window is split across all files in FILE-LIST, as evenly as
possible.  Remaining lines go to the bottom-most window.  The number of
files that can be displayed this way is restricted by the height of the
current window and the variable `window-min-height'.  With non-nil
NOSELECT the files are merely found but not selected."

  ;; We don't make this function interactive because it is usually too clumsy
  ;; to specify FILE-LIST interactively unless via dired.
  
  ;; Calculate and check window size.
  (let ((size (/ (window-height) (length file-list))))
    (if (or noselect (>= window-min-height size))
        ;; Do not select the buffer.
        (loop for f in file-list do (find-file-noselect f))
        ;; We will have to select the buffer.
        ;; Vertically split off a window of desired size.  Upper window will
        ;; have SIZE lines.  Select lower (larger) window.  We split it again.
        (find-file (car file-list))
        (loop for f in (cdr file-list)
           do (progn
                (select-window (split-window nil size))
                (find-file f))))))


-- 
Thierry Volpiatto
Gpg key: http://pgp.mit.edu/





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-20  7:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-20  7:33 change behavior of dired-simultaneous-find-file Thierry Volpiatto

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.