all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 5803@debbugs.gnu.org, deng@randomsample.de
Subject: bug#5803: 23.1.94; Using tq-enqueue in timer messes with keystroke echoing
Date: Thu, 10 Dec 2020 17:41:51 +0200	[thread overview]
Message-ID: <83czzh4qio.fsf@gnu.org> (raw)
In-Reply-To: <87h7oux1l8.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed,  09 Dec 2020 19:42:59 +0100)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: 5803@debbugs.gnu.org,  deng@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...





  reply	other threads:[~2020-12-10 15:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-29 22:54 bug#5803: 23.1.94; Using tq-enqueue in timer messes with keystroke echoing David Engster
2020-12-08 18:02 ` Lars Ingebrigtsen
2020-12-08 18:37   ` Eli Zaretskii
2020-12-09 12:38     ` Lars Ingebrigtsen
2020-12-09 15:39       ` Eli Zaretskii
2020-12-09 17:55   ` Eli Zaretskii
2020-12-09 18:42     ` Lars Ingebrigtsen
2020-12-10 15:41       ` Eli Zaretskii [this message]
2020-12-10 17:29         ` Stefan Monnier
2020-12-10 18:20           ` Eli Zaretskii
2020-12-10 18:40             ` Stefan Monnier
2020-12-10 18:49               ` Eli Zaretskii
2020-12-11  7:26                 ` Eli Zaretskii
2020-12-12 14:57                   ` Stefan Monnier
2020-12-12 15:26                     ` Lars Ingebrigtsen
2020-12-11 12:33                 ` Lars Ingebrigtsen
2020-12-11 12:55                   ` Eli Zaretskii
2020-12-17 16:36 ` bug#5803: " Platon Pronko
2020-12-23 12:35 ` Platon Pronko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83czzh4qio.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=5803@debbugs.gnu.org \
    --cc=deng@randomsample.de \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.