Subject: bug#5803: 23.1.94; Using tq-enqueue in timer messes with keystroke echoing

From: Eli Zaretskii <[email-masked]>
Date: Wed, 09 Dec 2020 19:55:13 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Date: Tue, 08 Dec 2020 19:02:51 +0100
> Cc: [email-masked]
> 
> I can reproduce this in Emacs 28 with this small change:
> 
> (setq proc (start-process "shell" (get-buffer-create "*process*") "/bin/sh"))
> (setq mytq (tq-create proc))
> (defun send-test ()
>   (tq-enqueue mytq "echo TEST\n" "TEST[^0]*" nil 'ignore))
> (setq timer (run-with-timer 1 1 'send-test))

When I run this, I get an error message about spurious
communications.  Does it work cleanly for you?

Do we really need this tq package to reproduce the issue?  It adds a
layer of complexity to a scenario that is complex to begin with.  I
hope there can be a recipe that avoids using tq.