comparison lisp/calendar/appt.el @ 9551:ac21ac5e8c69

(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.
author Richard M. Stallman <rms@gnu.org>
date Sun, 16 Oct 1994 01:42:08 +0000
parents e54eede71446
children 030e5a06a38a
comparison
equal deleted inserted replaced
9550:5b91f8657de6 9551:ac21ac5e8c69
383 (beep 1)))) 383 (beep 1))))
384 384
385 (defun appt-delete-window () 385 (defun appt-delete-window ()
386 "Function called to undisplay appointment messages. 386 "Function called to undisplay appointment messages.
387 Usually just deletes the appointment buffer." 387 Usually just deletes the appointment buffer."
388 (delete-window (get-buffer-window appt-buffer-name t)) 388 (let ((window (get-buffer-window appt-buffer-name t)))
389 (and window
390 (or (and (fboundp 'frame-root-window)
391 (eq window (frame-root-window (window-frame window))))
392 (delete-window window))))
389 (kill-buffer appt-buffer-name) 393 (kill-buffer appt-buffer-name)
390 (if appt-audible 394 (if appt-audible
391 (beep 1))) 395 (beep 1)))
392 396
393 ;; Select the lowest window on the frame. 397 ;; Select the lowest window on the frame.
394 (defun appt-select-lowest-window () 398 (defun appt-select-lowest-window ()
395 (setq lowest-window (selected-window)) 399 (let* ((lowest-window (selected-window))
396 (let* ((bottom-edge (car (cdr (cdr (cdr (window-edges)))))) 400 (bottom-edge (car (cdr (cdr (cdr (window-edges))))))
397 (last-window (previous-window)) 401 (last-window (previous-window))
398 (window-search t)) 402 (window-search t))
399 (while window-search 403 (while window-search
400 (let* ((this-window (next-window)) 404 (let* ((this-window (next-window))
401 (next-bottom-edge (car (cdr (cdr (cdr 405 (next-bottom-edge (car (cdr (cdr (cdr
438 (prin1-to-string (car (cdr element))) 442 (prin1-to-string (car (cdr element)))
439 " from list? ")) 443 " from list? "))
440 (test-input (y-or-n-p prompt-string))) 444 (test-input (y-or-n-p prompt-string)))
441 (setq tmp-msg-list (cdr tmp-msg-list)) 445 (setq tmp-msg-list (cdr tmp-msg-list))
442 (if test-input 446 (if test-input
443 (setq appt-time-msg-list (delq element appt-time-msg-list))) 447 (setq appt-time-msg-list (delq element appt-time-msg-list)))))
444 (setq tmp-appt-msg-list nil)))
445 (message ""))) 448 (message "")))
446 449
447 450
448 ;; Create the appointments list from todays diary buffer. 451 ;; Create the appointments list from todays diary buffer.
449 ;; The time must be at the beginning of a line for it to be 452 ;; The time must be at the beginning of a line for it to be