+2011-06-12 Martin Rudalics <rudalics@gmx.at>
+
+ * window.el (window-safely-shrinkable-p): Restore function which
+ was inadvertently removed in change from 2011-06-11. Declare as
+ obsolete.
+
+ * calendar/calendar.el (calendar-generate-window): Use
+ window-iso-combined-p instead of combination of one-window-p and
+ window-safely-shrinkable-p.
+
2011-06-12 Glenn Morris <rgm@gnu.org>
* progmodes/fortran.el (fortran-mode-syntax-table):
;; Don't do any window-related stuff if we weren't called from a
;; window displaying the calendar.
(when in-calendar-window
- ;; The second test used to be window-full-width-p.
- ;; Not sure what it was/is for, except perhaps some way of saying
- ;; "try not to mess with existing configurations".
- ;; If did the wrong thing on wide frames, where we have done a
- ;; horizontal split in calendar-basic-setup.
- (if (or (one-window-p t) (not (window-safely-shrinkable-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))
+ (if (window-iso-combined-p)
+ ;; Adjust the window to exactly fit the displayed calendar.
+ (fit-window-to-buffer nil nil calendar-minimum-window-height)
+ ;; For a full height window or a window that is horizontally
+ ;; combined don't fit height to that of its buffer.
+ (set-window-vscroll nil 0))
(sit-for 0))
(and (bound-and-true-p font-lock-mode)
(font-lock-fontify-buffer))
(error (setq delta nil)))
delta))))
+(defun window-safely-shrinkable-p (&optional window)
+ "Return t if WINDOW can be shrunk without shrinking other windows.
+WINDOW defaults to the selected window."
+ (with-selected-window (or window (selected-window))
+ (let ((edges (window-edges)))
+ ;; The following doesn't satisfy the doc-string's claim when
+ ;; window and previous-/next-window are not part of the same
+ ;; combination but still share a common edge. Using
+ ;; `window-iso-combined-p' instead should handle that.
+ (or (= (nth 2 edges) (nth 2 (window-edges (previous-window))))
+ (= (nth 0 edges) (nth 0 (window-edges (next-window))))))))
+(make-obsolete
+ 'window-safely-shrinkable-p "use `window-iso-combined-p' instead." "24.1")
+
(defun shrink-window-if-larger-than-buffer (&optional window)
"Shrink height of WINDOW if its buffer doesn't need so many lines.
More precisely, shrink WINDOW vertically to be as small as