(appt-select-lowest-window): Locally bind lowest-window.
authorRichard M. Stallman <rms@gnu.org>
Sun, 16 Oct 1994 01:42:08 +0000 (01:42 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 16 Oct 1994 01:42:08 +0000 (01:42 +0000)
(appt-delete): Don't set tmp-appt-msg-list.

(appt-delete-window): Avoid error if WINDOW is nil.

(appt-delete-window): Do nothing if the window
is the only one in its frame.

lisp/calendar/appt.el

index 4bbfe2c..24f2259 100644 (file)
@@ -385,15 +385,19 @@ Therefore, you need to have `(display-time)' in your .emacs file."
 (defun appt-delete-window ()
   "Function called to undisplay appointment messages.
 Usually just deletes the appointment buffer."
-  (delete-window (get-buffer-window appt-buffer-name t))
+  (let ((window (get-buffer-window appt-buffer-name t)))
+    (and window
+        (or (and (fboundp 'frame-root-window)
+                 (eq window (frame-root-window (window-frame window))))
+            (delete-window window))))
   (kill-buffer appt-buffer-name)
   (if appt-audible
       (beep 1)))
 
 ;; Select the lowest window on the frame.
 (defun appt-select-lowest-window ()
-  (setq lowest-window (selected-window))
-  (let* ((bottom-edge (car (cdr (cdr (cdr (window-edges))))))
+  (let* ((lowest-window (selected-window))
+        (bottom-edge (car (cdr (cdr (cdr (window-edges))))))
          (last-window (previous-window))
          (window-search t))
     (while window-search
@@ -440,8 +444,7 @@ The time should be in either 24 hour format or am/pm format."
              (test-input (y-or-n-p prompt-string)))
         (setq tmp-msg-list (cdr tmp-msg-list))
         (if test-input
-            (setq appt-time-msg-list (delq element appt-time-msg-list)))
-        (setq tmp-appt-msg-list nil)))
+            (setq appt-time-msg-list (delq element appt-time-msg-list)))))
     (message "")))