GNU bug report logs -
#5803
23.1.94; Using tq-enqueue in timer messes with keystroke echoing
Previous Next
Reported by: David Engster <deng <at> randomsample.de>
Date: Mon, 29 Mar 2010 23:16:02 UTC
Severity: normal
Tags: fixed
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: 5803 <at> debbugs.gnu.org, deng <at> randomsample.de
> Date: Wed, 09 Dec 2020 19:42:59 +0100
>
> (setq proc (start-process "shell" (get-buffer-create "*process*") "/bin/sh"))
> (defun send-test ()
> (process-send-string proc "ls /tmp\n"))
> (setq timer (run-with-timer 1 1 'send-test))
>
> I then hit
>
> C-x
>
> and I don't get the "C-x-" prompt.
Thanks.
I found the discussion about a related issue we had in the past, it
starts here:
https://lists.gnu.org/archive/html/emacs-devel/2018-09/msg00863.html
and the analysis is here:
https://lists.gnu.org/archive/html/emacs-devel/2018-09/msg00899.html
That patch was installed, but it only fixes the while-no-input
problem. It doesn't fix this problem, which has the same root cause:
the buffer-switch event we inject when output from a subprocess
arrives is considered valid input, and so when sit_for makes this
test:
return detect_input_pending () ? Qnil : Qt; <<<<<<<<<<<<<<<<<<<
it returns nil, and the keystroke echo is not displayed, because the
logic in keyboard.c assumes this means the user typed something.
So I think one way of fixing this is to make the test at the end of
sit_for smarter: if the only event in the input queue is the
buffer-change event, ignore it and return non-nil. (Alternatively, we
could do this in read_char, where sit_for is called.)
As yet another alternative, we could ask Stefan whether the patch he
suggested back then is still being used, and if so, whether there were
any adverse effects. He promised to report back in
https://lists.gnu.org/archive/html/emacs-devel/2018-09/msg00914.html
but AFAIR never did...
This bug report was last modified 4 years and 148 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.