aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2011-06-12 09:46:56 +0200
committerMartin Rudalics2011-06-12 09:46:56 +0200
commit39cffb4422b22282a32a29946b3e038f32ce90b5 (patch)
tree5926be8a603ff87fcf11c7d6977912a17e43cbdf
parent7b7f97e8b3d5675a09962253f31b3ab9d5962483 (diff)
downloademacs-39cffb4422b22282a32a29946b3e038f32ce90b5.tar.gz
emacs-39cffb4422b22282a32a29946b3e038f32ce90b5.zip
Restore window-safely-shrinkable-p but avoid using it in calendar.el.
* 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.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/calendar/calendar.el17
-rw-r--r--lisp/window.el14
3 files changed, 30 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c14655699e7..a72f2a89d99 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12011-06-12 Martin Rudalics <rudalics@gmx.at>
2
3 * window.el (window-safely-shrinkable-p): Restore function which
4 was inadvertently removed in change from 2011-06-11. Declare as
5 obsolete.
6
7 * calendar/calendar.el (calendar-generate-window): Use
8 window-iso-combined-p instead of combination of one-window-p and
9 window-safely-shrinkable-p.
10
12011-06-12 Glenn Morris <rgm@gnu.org> 112011-06-12 Glenn Morris <rgm@gnu.org>
2 12
3 * progmodes/fortran.el (fortran-mode-syntax-table): 13 * progmodes/fortran.el (fortran-mode-syntax-table):
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index fa19d1ffe14..2c38101588c 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1373,17 +1373,12 @@ Optional integers MON and YR are used instead of today's date."
1373 ;; Don't do any window-related stuff if we weren't called from a 1373 ;; Don't do any window-related stuff if we weren't called from a
1374 ;; window displaying the calendar. 1374 ;; window displaying the calendar.
1375 (when in-calendar-window 1375 (when in-calendar-window
1376 ;; The second test used to be window-full-width-p. 1376 (if (window-iso-combined-p)
1377 ;; Not sure what it was/is for, except perhaps some way of saying 1377 ;; Adjust the window to exactly fit the displayed calendar.
1378 ;; "try not to mess with existing configurations". 1378 (fit-window-to-buffer nil nil calendar-minimum-window-height)
1379 ;; If did the wrong thing on wide frames, where we have done a 1379 ;; For a full height window or a window that is horizontally
1380 ;; horizontal split in calendar-basic-setup. 1380 ;; combined don't fit height to that of its buffer.
1381 (if (or (one-window-p t) (not (window-safely-shrinkable-p))) 1381 (set-window-vscroll nil 0))
1382 ;; Don't mess with the window size, but ensure that the first
1383 ;; line is fully visible.
1384 (set-window-vscroll nil 0)
1385 ;; Adjust the window to exactly fit the displayed calendar.
1386 (fit-window-to-buffer nil nil calendar-minimum-window-height))
1387 (sit-for 0)) 1382 (sit-for 0))
1388 (and (bound-and-true-p font-lock-mode) 1383 (and (bound-and-true-p font-lock-mode)
1389 (font-lock-fontify-buffer)) 1384 (font-lock-fontify-buffer))
diff --git a/lisp/window.el b/lisp/window.el
index ace82826e67..94ac9143efd 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4481,6 +4481,20 @@ WINDOW was scrolled."
4481 (error (setq delta nil))) 4481 (error (setq delta nil)))
4482 delta)))) 4482 delta))))
4483 4483
4484(defun window-safely-shrinkable-p (&optional window)
4485 "Return t if WINDOW can be shrunk without shrinking other windows.
4486WINDOW defaults to the selected window."
4487 (with-selected-window (or window (selected-window))
4488 (let ((edges (window-edges)))
4489 ;; The following doesn't satisfy the doc-string's claim when
4490 ;; window and previous-/next-window are not part of the same
4491 ;; combination but still share a common edge. Using
4492 ;; `window-iso-combined-p' instead should handle that.
4493 (or (= (nth 2 edges) (nth 2 (window-edges (previous-window))))
4494 (= (nth 0 edges) (nth 0 (window-edges (next-window))))))))
4495(make-obsolete
4496 'window-safely-shrinkable-p "use `window-iso-combined-p' instead." "24.1")
4497
4484(defun shrink-window-if-larger-than-buffer (&optional window) 4498(defun shrink-window-if-larger-than-buffer (&optional window)
4485 "Shrink height of WINDOW if its buffer doesn't need so many lines. 4499 "Shrink height of WINDOW if its buffer doesn't need so many lines.
4486More precisely, shrink WINDOW vertically to be as small as 4500More precisely, shrink WINDOW vertically to be as small as