Subject: Re: bug#21969: VC opens new window to display minimal messages

From: Dmitry Gutov <[email-masked]>
Date: Sun, 22 Nov 2015 02:04:06 +0200

On 11/21/2015 03:55 PM, David Reitter wrote:
> At some point on the way to Emacs 25, VC has begun creating new windows to display messages that would more appropriately fit into the echo area.
>
> For example, you do C-x =, it’ll display a “no revisions between working revision and work file” message.  But that is shown in the echo area AND a newly created window.

Looking at the code, the main reason for this is that the '<backend> 
diff' command is called asynchronously. Before Emacs 25, we made 
exceptions for certain backends (Git, Hg, RCS); not sure why, maybe 
because they're faster that the rest? They're treated the same now, 
since ed6ce56e2.

vc-diff-internal calls the 'diff' backend command, then checks if the 
process in its buffer has finished working and there's no output (which 
might be the case if the command was called *synchronously*), pops a 
window and sets up the code to be executed when the process finishes.

All of which seems reasonable: we can't really pop the window only after 
the process finishes, because if might take some time in certain cases, 
and the user would be still be waiting for anything to happen until then.

So, I'm not sure what's the best course of action here:

- Call 'git diff' synchronously, and leave all other backends with this 
problem.

- Call all 'diff' commands synchronously, and disregard the backends 
that might respond slowly to this command; the user will wait.

- Invent some other solutions, like introduce a timeout which we might 
wait for the backend to respond before popping the window, and abort (?) 
if the user interacts with Emacs during that time.

Suggestions welcome.