Mercurial > emacs
comparison lisp/calendar/appt.el @ 77192:2b47f00a7c16
(appt-disp-window): Do not split small windows.
Suggested by Jeff Miller <jmiller@cablespeed.com>.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 14 Apr 2007 02:36:58 +0000 |
parents | 7a3f13e2dd57 |
children | 93e11478c954 e6fdae9180d4 |
comparison
equal
deleted
inserted
replaced
77191:28cf638a604a | 77192:2b47f00a7c16 |
---|---|
231 The variable `appt-audible' controls the audible reminder." | 231 The variable `appt-audible' controls the audible reminder." |
232 ;; let binding for backwards compatability. Remove when obsolete | 232 ;; let binding for backwards compatability. Remove when obsolete |
233 ;; vars appt-msg-window and appt-visible are dropped. | 233 ;; vars appt-msg-window and appt-visible are dropped. |
234 (let ((appt-display-format | 234 (let ((appt-display-format |
235 (if (eq appt-display-format 'ignore) | 235 (if (eq appt-display-format 'ignore) |
236 (cond (appt-msg-window 'window) | 236 (cond (appt-msg-window 'window) |
237 (appt-visible 'echo)) | 237 (appt-visible 'echo)) |
238 appt-display-format))) | 238 appt-display-format))) |
239 (cond ((eq appt-display-format 'window) | 239 (cond ((eq appt-display-format 'window) |
240 (funcall appt-disp-window-function | 240 (funcall appt-disp-window-function |
241 (number-to-string mins) | 241 (number-to-string mins) |
242 ;; TODO - use calendar-month-abbrev-array rather | 242 ;; TODO - use calendar-month-abbrev-array rather |
455 (display-buffer appt-disp-buf) | 455 (display-buffer appt-disp-buf) |
456 (unless (or (special-display-p (buffer-name appt-disp-buf)) | 456 (unless (or (special-display-p (buffer-name appt-disp-buf)) |
457 (same-window-p (buffer-name appt-disp-buf))) | 457 (same-window-p (buffer-name appt-disp-buf))) |
458 ;; By default, split the bottom window and use the lower part. | 458 ;; By default, split the bottom window and use the lower part. |
459 (appt-select-lowest-window) | 459 (appt-select-lowest-window) |
460 (select-window (split-window))) | 460 ;; Split the window, unless it's too small to do so. |
461 (when (>= (window-height) (* 2 window-min-height)) | |
462 (select-window (split-window)))) | |
461 (switch-to-buffer appt-disp-buf)) | 463 (switch-to-buffer appt-disp-buf)) |
462 (calendar-set-mode-line | 464 (calendar-set-mode-line |
463 (format " Appointment in %s minutes. %s " min-to-app new-time)) | 465 (format " Appointment in %s minutes. %s " min-to-app new-time)) |
464 (erase-buffer) | 466 (erase-buffer) |
465 (insert appt-msg) | 467 (insert appt-msg) |