From 77a7efce7e9f14b7ef238c54d3390a63b8b79c9f Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Sun, 27 Jun 1999 21:23:26 +0000 Subject: [PATCH] (calendar-only-one-frame-setup): New function. --- lisp/calendar/cal-x.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lisp/calendar/cal-x.el b/lisp/calendar/cal-x.el index 1e6cf4b0dcf..7151671d722 100644 --- a/lisp/calendar/cal-x.el +++ b/lisp/calendar/cal-x.el @@ -96,6 +96,25 @@ Can be used to change frame parameters, such as font, color, location, etc.") fancy-diary-buffer)) 'diary)))))) +(defun calendar-only-one-frame-setup (&optional arg) + "Start calendar and display it in a dedicated frame." + (if (not window-system) + (calendar-basic-setup arg) + (if (frame-live-p calendar-frame) (delete-frame calendar-frame)) + (let ((special-display-buffer-names nil) + (view-diary-entries-initially nil)) + (save-window-excursion + (save-excursion + (setq calendar-frame + (make-frame calendar-frame-parameters)) + (run-hooks 'calendar-after-frame-setup-hooks) + (select-frame calendar-frame) + (if (eq 'icon (cdr (assoc 'visibility + (frame-parameters calendar-frame)))) + (iconify-or-deiconify-frame)) + (calendar-basic-setup arg) + (set-window-dedicated-p (selected-window) 'calendar)))))) + (defun calendar-two-frame-setup (&optional arg) "Start calendar and diary in separate, dedicated frames." (if (not window-system) -- 2.39.2