Subject: bug#1806: dired-pop-to-buffer in wrong place

From: martin rudalics <[email-masked]>
Date: Mon, 18 May 2009 10:11:54 +0200

> Could you also fix Proced and Calendar?

I attached a similar patch for `proced-send-signal'.  I don't know what
to do about `proced' itself.  Roland what do you think?

martin
*** proced.el.~1.36.~	2009-04-21 07:18:50.000000000 +0200
--- proced.el	2009-05-18 10:01:50.031250000 +0200
***************
*** 1720,1728 ****
            (dolist (process process-alist)
              (insert "  " (cdr process) "\n"))
            (save-window-excursion
!             ;; Analogous to `dired-pop-to-buffer'
!             ;; Don't split window horizontally.  (Bug#1806)
!             (let (split-width-threshold)
                (pop-to-buffer (current-buffer)))
              (fit-window-to-buffer (get-buffer-window) nil 1)
              (let* ((completion-ignore-case t)
--- 1720,1735 ----
            (dolist (process process-alist)
              (insert "  " (cdr process) "\n"))
            (save-window-excursion
!             ;; Analogous to `dired-pop-to-buffer'.
! 	    (let ((split-window-preferred-function
! 		   (lambda (window)
! 		     (or (and (let ((split-height-threshold 0))
! 				(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 (current-buffer)))
              (fit-window-to-buffer (get-buffer-window) nil 1)
              (let* ((completion-ignore-case t)