Subject: bug#34763: 27.0.50; url-retrieve-synchronously misbehaves inside eldoc-documentation-function

From: Dmitry Gutov <[email-masked]>
Date: Tue, 12 Mar 2019 17:02:31 +0200

Some further investigation follows.

I've checked out the revision before the one where eldoc started to use 
while-no-input (6d898918980be4cb29a182ecde7f8e1f95a08462) and repeated 
the scenario.

Predictably, Emacs was considerably less responsive, lots of pauses 
waiting for the replies from the remote server.

Also predictably, no "Transfer interrupted" messages until I press C-g.

But I still reach the state where Emacs seemingly just freezes with 
"Contacting host: www.google.com:80" in the echo area, and even faster 
than with the current Emacs master (within the first 10-20 seconds).

I can abort that with tapping C-g, see that "Transfer interrupted" 
message (Emacs still frozen), and then tapping C-g again to see "eldoc 
error: (error Interrupted!)", wait a second, and see "Quit".

The message log is only slightly different: it consistently says:

"error in process sentinel: url-http-end-of-document-sentinel: Transfer 
interrupted!"

Whereas previously, I mostly seen other sentinels mentioned here.

After Emacs freezes this way once and I C-g out of it, similarly to the 
original problem description, any subsequent call to silly-eldoc freezes 
right away. Calling url-retrieve-synchronously from eval-expression, 
meanwhile, works (although kind of slowly).

This reminds me strongly of a problem with my third-party package 
reported by several people, which I never managed to cleanly reproduce: 
https://github.com/dgutov/robe/issues/105

Also tried this in Emacs 25.2, the scenario reproduces almost exactly.