GNU bug report logs - #1806
dired-pop-to-buffer in wrong place

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Tue, 6 Jan 2009 15:40:04 UTC

Severity: normal

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Juri Linkov <juri <at> jurta.org>, 1806 <at> debbugs.gnu.org
Subject: bug#1806: dired-pop-to-buffer in wrong place
Date: Tue, 05 May 2009 09:04:53 +0200
[Message part 1 (text/plain, inline)]
 >> `dired-pop-to-buffer' could bind `split-window-preferred-function' to a
 >> function that tries to always split the selected window instead of
 >> whatever window was chosen by `display-buffer' but that would override
 >> any user customizations of `split-window-preferred-function'.
 >
 > Why would it override it?  It would of course bind
 > split-window-preferred-function to a function that selects the right
 > window and then calls the previous value.

As a matter of fact, we do have to override the users' customizations
here just as Juri suggested earlier.  Suppose a user has set
`split-window-preferred-function' to the standard option "horizontally"
which always splits a window horizontally.  Then `dired-pop-to-buffer'
simply cannot get a vertical split when it calls the original
`split-window-preferred-function'.  So we probably have to do this as in
the attached patch :-(

martin

[dired.el.diff (text/plain, inline)]
*** dired.el.~1.422.~	2009-04-18 08:32:56.546875000 +0200
--- dired.el	2009-05-05 09:00:38.609375000 +0200
***************
*** 2686,2693 ****
  
  (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)
      (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
--- 2686,2697 ----
  
  (defun dired-pop-to-buffer (buf)
    "Pop up buffer BUF in a way suitable for Dired."
!   (let ((split-window-preferred-function
! 	 (lambda (window)
! 	   ;; Split window vertically and deliberately ignore the WINDOW
! 	   ;; argument of `split-window-preferred-function' so the
! 	   ;; selected window gets split instead (Bug#1806).
! 	   (split-window-vertically))))
      (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


This bug report was last modified 12 years and 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.