Subject: bug#3419: 23.0.94; calc, calendar and temp-buffer-resize-mode

From: Juri Linkov <[email-masked]>
Date: Thu, 03 Nov 2011 21:44:05 +0200

>> But I meant that *Calculator* and *Calc Trail* windows could be
>> displayed with `display-buffer' and an appropriate ACTION argument.
>> Then users will be able to customize its default behavior.
>
> Can't they already do that with display-buffer-alist?

`display-buffer-alist' can't undo splitting done outside of the
`display-buffer' call.  When splitting is done in a display action,
user can easily override it.  For instance, a new action
`display-buffer-pop-up-window-below' I posted in bug#9873
does splitting that users can override.  This action
can be used in `calendar-generate-window', and when I tested it,
I observe finally the ideal behavior of `M-x calendar RET'
in many different window configurations with this very small patch:

=== modified file 'lisp/calendar/calendar.el'
--- lisp/calendar/calendar.el	2011-10-30 08:29:56 +0000
+++ lisp/calendar/calendar.el	2011-11-03 19:36:29 +0000
@@ -1331,7 +1331,7 @@ (defun calendar-basic-setup (&optional a
         ;;
         ;; Is this a wide frame?  If so, split it horizontally.
         (if (window-splittable-p t) (split-window-right))
-        (pop-to-buffer calendar-buffer)
+        (pop-to-buffer calendar-buffer '(display-buffer-pop-up-window-below))
         ;; Has the window already been split vertically?
         (when (and (not (window-dedicated-p))
                    (window-full-height-p))