Commit 54c792ec authored by Juri Linkov's avatar Juri Linkov

* lisp/subr.el: Add discard-input to more functions.

* lisp/subr.el (read-char-from-minibuffer-insert-other)
(y-or-n-p-insert-other): Use discard-input in case of user mistake.
(do-after-load-evaluation): Add discard-input before calling 'message',
so in case of the active minibuffer, calling minibuffer-message will allow
sit-for to wait the complete timeout, because discard-input will discard
all initial events that prevent sit-for from waiting during startup.
parent 757e66af
......@@ -2695,6 +2695,7 @@ Also discard all previous input in the minibuffer."
(minibuffer-message "Wrong answer")
(sit-for 2))
......@@ -2794,6 +2795,7 @@ Also discard all previous input in the minibuffer."
(minibuffer-message "Please answer y or n")
(sit-for 2))
......@@ -4607,7 +4609,7 @@ This function is called directly from the C code."
(string-match "\\.elc?\\>" file))
(msg (format "Package %s is deprecated" package))
(fun (lambda (msg) (message "%s" msg))))
(fun (lambda (msg) (discard-input) (message "%s" msg))))
;; Cribbed from cl--compiling-file.
(when (or (not (fboundp 'byte-compile-warning-enabled-p))
(byte-compile-warning-enabled-p 'obsolete package))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment