aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2009-10-03 02:19:22 +0000
committerGlenn Morris2009-10-03 02:19:22 +0000
commit686ea556eb13d889d1b7ecb0aae005315ea7e128 (patch)
treeaabed8e8b3d1c3beac0bed7057cce6ba492f1bce
parent619392fc977cfbbf10e2bbdcdec9dd2c290da9a4 (diff)
downloademacs-686ea556eb13d889d1b7ecb0aae005315ea7e128.tar.gz
emacs-686ea556eb13d889d1b7ecb0aae005315ea7e128.zip
(calendar-basic-setup): Handle the case where the frame is wide.
(calendar-generate-window): Test for shrinkability rather than width.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/calendar/calendar.el44
2 files changed, 46 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 88c4553718e..7a0fa0526d3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12009-10-03 Glenn Morris <rgm@gnu.org> 12009-10-03 Glenn Morris <rgm@gnu.org>
2 2
3 * calendar/calendar.el (calendar-basic-setup): Handle the case where
4 the frame is wide.
5 (calendar-generate-window): Test for shrinkability rather than width.
6
3 * cedet/semantic/db-find.el (data-debug-insert-tag-list): Comment out 7 * cedet/semantic/db-find.el (data-debug-insert-tag-list): Comment out
4 declaration, currently false. 8 declaration, currently false.
5 9
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 2617c8004b7..4c033dd8917 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1283,6 +1283,8 @@ display the generated calendar."
1283 (set-buffer (get-buffer-create calendar-buffer)) 1283 (set-buffer (get-buffer-create calendar-buffer))
1284 (calendar-mode) 1284 (calendar-mode)
1285 (let* ((pop-up-windows t) 1285 (let* ((pop-up-windows t)
1286 ;; Not really needed now, but means we use exactly the same
1287 ;; behavior as before in the non-wide case (see below).
1286 (split-height-threshold 1000) 1288 (split-height-threshold 1000)
1287 (date (if arg (calendar-read-date t) 1289 (date (if arg (calendar-read-date t)
1288 (calendar-current-date))) 1290 (calendar-current-date)))
@@ -1291,7 +1293,40 @@ display the generated calendar."
1291 (calendar-increment-month month year (- calendar-offset)) 1293 (calendar-increment-month month year (- calendar-offset))
1292 ;; Display the buffer before calling calendar-generate-window so that it 1294 ;; Display the buffer before calling calendar-generate-window so that it
1293 ;; can get a chance to adjust the window sizes to the frame size. 1295 ;; can get a chance to adjust the window sizes to the frame size.
1294 (or nodisplay (pop-to-buffer calendar-buffer)) 1296 (unless nodisplay
1297 ;; We want a window configuration that looks something like
1298 ;; X X | Y
1299 ;; - -----
1300 ;; C Z | C
1301 ;; where C is the calendar, and the LHS is the traditional,
1302 ;; non-wide frame, and the RHS is the wide frame case.
1303 ;; We should end up in the same state regardless of whether the
1304 ;; windows were initially split or not.
1305 ;; Previously, we only thought about the non-wide case.
1306 ;; We could just set split-height-threshold to 1000, relying on
1307 ;; the fact that the window splitting treated a single window as
1308 ;; a special case and would always split it (vertically). The
1309 ;; same thing does not work in the wide-frame case, so now we do
1310 ;; the splitting by hand.
1311 ;; See discussion in bug#1806.
1312 ;; Actually, this still does not do quite the right thing in the
1313 ;; wide frame case if started from a configuration like the LHS.
1314 ;; Eg if you start with a non-wide frame, call calendar, then
1315 ;; make the frame wider. This one is problematic because you
1316 ;; might need to split a totally unrelated window. Oh well, it
1317 ;; seems unlikely, and perhaps respecting the original layout is
1318 ;; the right thing in that case.
1319 ;;
1320 ;; Is this a wide frame? If so, split it horizontally.
1321 (if (window-splittable-p t) (split-window-horizontally))
1322 (pop-to-buffer calendar-buffer)
1323 ;; Has the window already been split vertically? (See bug#4543)
1324 (when (= (window-height) (window-height (frame-root-window)))
1325 (let ((win (split-window-vertically)))
1326 ;; Show something else in the upper window.
1327 (switch-to-buffer (other-buffer))
1328 ;; Switch to the lower window with the calendar buffer.
1329 (select-window win))))
1295 (calendar-generate-window month year) 1330 (calendar-generate-window month year)
1296 (if (and calendar-view-diary-initially-flag 1331 (if (and calendar-view-diary-initially-flag
1297 (calendar-date-is-visible-p date)) 1332 (calendar-date-is-visible-p date))
@@ -1325,7 +1360,12 @@ Optional integers MON and YR are used instead of today's date."
1325 ;; Don't do any window-related stuff if we weren't called from a 1360 ;; Don't do any window-related stuff if we weren't called from a
1326 ;; window displaying the calendar. 1361 ;; window displaying the calendar.
1327 (when in-calendar-window 1362 (when in-calendar-window
1328 (if (or (one-window-p t) (not (window-full-width-p))) 1363 ;; The second test used to be window-full-width-p.
1364 ;; Not sure what it was/is for, except perhaps some way of saying
1365 ;; "try not to mess with existing configurations".
1366 ;; If did the wrong thing on wide frames, where we have done a
1367 ;; horizontal split in calendar-basic-setup.
1368 (if (or (one-window-p t) (not (window-safely-shrinkable-p)))
1329 ;; Don't mess with the window size, but ensure that the first 1369 ;; Don't mess with the window size, but ensure that the first
1330 ;; line is fully visible. 1370 ;; line is fully visible.
1331 (set-window-vscroll nil 0) 1371 (set-window-vscroll nil 0)