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

From: Juri Linkov <[email-masked]>
Date: Tue, 19 May 2009 03:18:45 +0300

>> Could you also fix Proced and Calendar?
>
> I suppose you mean the call in `calendar-basic-setup' here.  In this
> case you probably want to split the largest or LRU window vertically
> even if your customized settings would imply a horizontal split.  But
> you don't insist on splitting the selected window.  Right?

It seems a fix is not as simple.  The function `calendar-generate-window'
comes into play and doesn't adjust the window to fit the displayed calendar
in horizontally split windows.  The condition (not (window-full-width-p))
prevents calling `fit-window-to-buffer':

      (if (or (one-window-p t) (not (window-full-width-p)))
          ;; Don't mess with the window size, but ensure that the first
          ;; line is fully visible.
          (set-window-vscroll nil 0)
        ;; Adjust the window to exactly fit the displayed calendar.
        (fit-window-to-buffer nil nil calendar-minimum-window-height))

Removing (not (window-full-width-p)) fixes this, but I don't know if this
change has some side effect.

-- 
Juri Linkov
http://www.jurta.org/emacs/