From: Richard M. Stallman Date: Sun, 16 Oct 1994 01:42:08 +0000 (+0000) Subject: (appt-select-lowest-window): Locally bind lowest-window. X-Git-Tag: emacs-19.34~6303 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=95cdbff5459a87a0786c7da3e5919c1f13a5f564;p=emacs.git (appt-select-lowest-window): Locally bind lowest-window. (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. --- diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index 4bbfe2ca542..24f2259f314 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el @@ -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 "")))