Improve interaction between track-mouse and edebug

* lisp/emacs-lisp/edebug.el (edebug--display-1): Work around
`track-mouse' oddity (bug#675).
This commit is contained in:
Lars Ingebrigtsen 2022-02-12 08:40:30 +01:00
parent 2b97e83cc1
commit c4da0d3312

View file

@ -2577,6 +2577,13 @@ See `edebug-behavior-alist' for implementations.")
;; Let's at least show a backtrace so the user can figure out
;; which function we're talking about.
(debug))
;; If we're in a `track-mouse' setting, then any previous mouse
;; movements will make `input-pending-p' later return true. So
;; discard the inputs in that case. (And `discard-input' doesn't
;; work here.)
(when track-mouse
(while (input-pending-p)
(read-event)))
;; Setup windows for edebug, determine mode, maybe enter recursive-edit.
;; Uses local variables of edebug-enter, edebug-before, edebug-after
;; and edebug-debugger.