Function: calendar-frame-setup
calendar-frame-setup is an autoloaded and byte-compiled function
defined in cal-x.el.gz.
Signature
(calendar-frame-setup CONFIG &optional PROMPT)
Documentation
Display the calendar, and optionally the diary, in a separate frame.
CONFIG should be one of:
calendar-only - just the calendar, no diary
one-frame - calendar and diary in a single frame
two-frames - calendar and diary each in a separate frame
If CONFIG has any other value, or if the display is not capable of
multiple frames, then calendar-basic-setup is called.
If PROMPT is non-nil, prompt for the month and year to use.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/cal-x.el.gz
;;;###cal-autoload
(defun calendar-frame-setup (config &optional prompt)
"Display the calendar, and optionally the diary, in a separate frame.
CONFIG should be one of:
`calendar-only' - just the calendar, no diary
`one-frame' - calendar and diary in a single frame
`two-frames' - calendar and diary each in a separate frame
If CONFIG has any other value, or if the display is not capable of
multiple frames, then `calendar-basic-setup' is called.
If PROMPT is non-nil, prompt for the month and year to use."
(if (not (and (display-multi-frame-p)
(memq config '(calendar-only one-frame two-frames))))
(calendar-basic-setup prompt)
(if (frame-live-p calendar-frame) (delete-frame calendar-frame))
(unless (eq config 'calendar-only)
(if (frame-live-p diary-frame) (delete-frame diary-frame)))
(let ((calendar-view-diary-initially-flag (eq config 'one-frame))
;; For calendar-dedicate-diary in two-frames case.
(pop-up-windows nil))
(save-window-excursion
;; Do diary first so that calendar is always left current.
(when (eq config 'two-frames)
(calendar-frame-1
(setq diary-frame (make-frame diary-frame-parameters)))
(diary)
(calendar-dedicate-diary))
(calendar-frame-1
(setq calendar-frame
(make-frame (if (eq config 'one-frame)
calendar-and-diary-frame-parameters
calendar-frame-parameters))))
(calendar-basic-setup prompt (not (eq config 'one-frame)))
(set-window-buffer (selected-window) calendar-buffer)
(set-window-dedicated-p (selected-window) t)
(if (eq config 'one-frame)
(calendar-dedicate-diary))))))