]> git.eshelyaron.com Git - emacs.git/commitdiff
(calendar-only-one-frame-setup): New function.
authorKarl Heuer <kwzh@gnu.org>
Sun, 27 Jun 1999 21:23:26 +0000 (21:23 +0000)
committerKarl Heuer <kwzh@gnu.org>
Sun, 27 Jun 1999 21:23:26 +0000 (21:23 +0000)
lisp/calendar/cal-x.el

index 1e6cf4b0dcf7fc93771fd33ed7d9010b6c56c1b0..7151671d7224680890db0d304b33f69ed6086c6b 100644 (file)
@@ -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)