* 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.
https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00581.html
(interactive)
(delete-minibuffer-contents)
(ding)
+ (discard-input)
(minibuffer-message "Wrong answer")
(sit-for 2))
(interactive)
(delete-minibuffer-contents)
(ding)
+ (discard-input)
(minibuffer-message "Please answer y or n")
(sit-for 2))
(string-match "\\.elc?\\>" file))
obarray))
(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))