From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: emacs-devel@gnu.org
Subject: change behavior of dired-simultaneous-find-file
Date: Sun, 20 Jun 2010 09:33:51 +0200 [thread overview]
Message-ID: <87iq5egnts.fsf@tux.homenetwork> (raw)
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/
reply other threads:[~2010-06-20 7:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87iq5egnts.fsf@tux.homenetwork \
--to=thierry.volpiatto@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.