Subject: Re: bug#37390: 26.3; ediff-buffers appears to have a focus issue

From: martin rudalics <[email-masked]>
Date: Fri, 13 Sep 2019 09:36:06 +0200

> In ediff-buffers mode, anytime you lose focus out of the ediff command
 > window (either by explicitly changing it OR executing an ediff selection of
 > a diff (via the 'a' or 'b' keys), all subsequent commands in the ediff
 > command window lose focus out of the window and you have to re-establish
 > focus after every ediff command.
 >
 > Try this to reproduce:
 >
 > cp ~/.profile /tmp/bufa
 > cp ~/.profile /tmp/bufbb
 > sed 's/x/y/' bufbb > bufb
 > emacs /tmp/bufa /tmp/bufb
 > In emacs diff the two buffers with M-x ediff-buffers
 > In the ediff command window
 > n
 > n
 > now change focus to any other window on your desktop OR pick diff 'a' or
 > 'b' to apply.
 > now change focus back to the ediff window

Is "ediff window" the frame where bufa and bufb are shown or the ediff
command window?

 > n
 > focus should have jumped out of the ediff command window to one of the
 > diffed buffers.

 > 26.2 did not do that; once back in the ediff command window, focus stayed
 > there after each ediff command. This issue makes it very annoying to
 > process diffs.

I cannot reproduce this behavior here.  After "n" focus stays in the
ediff command window.  But I faintly recall that I changed something
in this area a few years ago and that subsequently Stefan had problems
with his minibuffer in a separate frame setup.  That was something I
wasn't able to reproduce either.  It might be also window manager
dependent.

If you build Emacs yourself, you could you try bisecting this to find
the offending commit.  You could also look whether bug#11622 or
bug#35635 describe the same issue.  And maybe someone can reproduce
your use case and we can start digging from there.  If neither of
these help, we probably have to try to debug this issue by tracking
'handle-focus-in' which is no fun.

martin