summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2009-05-15 15:00:32 +0000
committerMartin Rudalics <rudalics@gmx.at>2009-05-15 15:00:32 +0000
commit19998f14b67de66754081cacdbca5668680c41ba (patch)
tree5015902a38ed86ad74b6c0ce2e083b61edb7cec0 /lisp/dired.el
parenta96da3ab42a7f3854522a368b0e585d4d30cb72d (diff)
downloademacs-19998f14b67de66754081cacdbca5668680c41ba.tar.gz
(dired-pop-to-buffer): Try to make this behave the
Emacs 22 way (Bug#1806).
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 087a05f3de4..0ccf4b128c4 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2686,8 +2686,14 @@ name, or the marker and a count of marked files."
(defun dired-pop-to-buffer (buf)
"Pop up buffer BUF in a way suitable for Dired."
- ;; Don't split window horizontally. (Bug#1806)
- (let (split-width-threshold)
+ (let ((split-window-preferred-function
+ (lambda (window)
+ (or (and (window-splittable-p (selected-window))
+ ;; Try to split the selected window vertically if
+ ;; that's possible. (Bug#1806)
+ (split-window-vertically))
+ ;; Otherwise, try to split WINDOW sensibly.
+ (split-window-sensibly window)))))
(pop-to-buffer (get-buffer-create buf)))
;; If dired-shrink-to-fit is t, make its window fit its contents.
(when dired-shrink-to-fit