From: Glenn Morris Date: Tue, 23 Jun 2015 18:02:24 +0000 (-0400) Subject: Check for an input event before showing a dialog box. (Bug#20813) X-Git-Tag: emacs-25.0.90~1665 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2ca5558395c92b25b58478627b426c66f8e4f170;p=emacs.git Check for an input event before showing a dialog box. (Bug#20813) * lisp/subr.el (y-or-n-p): * src/fns.c (Fyes_or_no_p): Check last-input-event as well as last-nonmenu-event. --- diff --git a/lisp/subr.el b/lisp/subr.el index df173102fe2..5d40aaae41c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2348,6 +2348,7 @@ is nil and `use-dialog-box' is non-nil." (t (setq temp-prompt (concat "Please answer y or n. " prompt)))))))) ((and (display-popup-menus-p) + last-input-event ; not during startup (listp last-nonmenu-event) use-dialog-box) (setq prompt (funcall padded prompt t) diff --git a/src/fns.c b/src/fns.c index 6bbb57ffd7d..cef2823ee76 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2686,7 +2686,7 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */) CHECK_STRING (prompt); if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) - && use_dialog_box) + && use_dialog_box && ! NILP (last_input_event)) { Lisp_Object pane, menu, obj; redisplay_preserve_echo_area (4);