# HG changeset patch # User Martin Rudalics # Date 1242399632 0 # Node ID 8cc53b11f92186f3a3ab9c0d529db9c3e45e900e # Parent c3d678b4c3238c3de32beaed34432ef459badcf7 (dired-pop-to-buffer): Try to make this behave the Emacs 22 way (Bug#1806). diff -r c3d678b4c323 -r 8cc53b11f921 lisp/ChangeLog --- a/lisp/ChangeLog Fri May 15 06:18:34 2009 +0000 +++ b/lisp/ChangeLog Fri May 15 15:00:32 2009 +0000 @@ -1,3 +1,8 @@ +2009-05-15 Martin Rudalics + + * dired.el (dired-pop-to-buffer): Try to make this behave the + Emacs 22 way (Bug#1806). + 2009-05-14 Chong Yidong * frame.el (minibuffer-frame-alist): Doc fix (Bug#3276). diff -r c3d678b4c323 -r 8cc53b11f921 lisp/dired.el --- a/lisp/dired.el Fri May 15 06:18:34 2009 +0000 +++ b/lisp/dired.el Fri May 15 15:00:32 2009 +0000 @@ -2686,8 +2686,14 @@ (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