# HG changeset patch # User Martin Rudalics # Date 1227520249 0 # Node ID 6638c3736a32ff52cc5daf910ea3666e7f7a9801 # Parent 83ae2ae7a4c4e41e8baed6c7062b72675260b0e6 (appt-disp-window): Move minibuffer check after binding this-window and do not set-buffer to make sure we won't deselect the minibuffer. diff -r 83ae2ae7a4c4 -r 6638c3736a32 lisp/calendar/appt.el --- a/lisp/calendar/appt.el Mon Nov 24 09:28:49 2008 +0000 +++ b/lisp/calendar/appt.el Mon Nov 24 09:50:49 2008 +0000 @@ -408,13 +408,13 @@ "Display appointment due in MIN-TO-APP (a string) minutes. NEW-TIME is a string giving the date. Displays the appointment message APPT-MSG in a separate buffer." - ;; Make sure we're not in the minibuffer before splitting the window. - ;; FIXME this seems needlessly complicated? - (when (minibufferp) - (other-window 1) - (and (minibufferp) (display-multi-frame-p) (other-frame 1))) (let ((this-window (selected-window)) - (appt-disp-buf (set-buffer (get-buffer-create appt-buffer-name)))) + (appt-disp-buf (get-buffer-create appt-buffer-name))) + ;; Make sure we're not in the minibuffer before splitting the window. + ;; FIXME this seems needlessly complicated? + (when (minibufferp) + (other-window 1) + (and (minibufferp) (display-multi-frame-p) (other-frame 1))) (if (cdr (assq 'unsplittable (frame-parameters))) ;; In an unsplittable frame, use something somewhere else. (display-buffer appt-disp-buf)