changeset 24890:5f37b93c8538

(calendar-only-one-frame-setup): New function.
author Karl Heuer <kwzh@gnu.org>
date Sun, 27 Jun 1999 21:23:26 +0000
parents 38f43c2c5afa
children 85d8302a2e82
files lisp/calendar/cal-x.el
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/cal-x.el	Sun Jun 27 21:21:31 1999 +0000
+++ b/lisp/calendar/cal-x.el	Sun Jun 27 21:23:26 1999 +0000
@@ -96,6 +96,25 @@
               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)