Subject: bug#51788: cua + ansi-term hangs

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 20 Sep 2022 15:22:32 +0200

Samuel Muñoz Hidalgo <[email-masked]> writes:

> 1- Select a text in a buffer and use the keybind F2 instead of calling the function
> manually. It opens a terminal with the selected word pasted in it.
> 3- Type C-c or (C-x) and emacs freezes with a 100% CPU usage in a single core.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I can reproduce this in Emacs 29.  Setting debug-on-quit and hitting
`C-g' give me the following backtrace:

Debugger entered--Lisp error: (quit)
  timer--activate([t 25385 48685 328606 nil cua--prefix-override-timeout nil nil 450000 nil] nil nil nil)
  timer-activate([t 25385 48685 328606 nil cua--prefix-override-timeout nil nil 450000 nil])
  run-at-time(0.2 nil cua--prefix-override-timeout)
  apply(run-at-time 0.2 nil cua--prefix-override-timeout nil)
  run-with-timer(0.2 nil cua--prefix-override-timeout)
  cua--prefix-override-replay(0)
  cua-copy-handler()
  funcall-interactively(cua-copy-handler)
  call-interactively(cua-copy-handler nil nil)

I'm wholly unfamiliar with cua-mode, though.  Does anybody else know
what could be happening here?