Subject: bug#12218: 24.2.50; vc-ediff: Pressing `n' moves focus away from ediff control panel

From: Jambunathan K <[email-masked]>
Date: Sat, 06 Oct 2012 01:12:07 +0530

martin rudalics <[email-masked]> writes:

>> I don't know how to use `ediff-setup-windows-plain'.  Can you give more
>> information?
>
> I have the following ediff-related settings in my .emacs:
>
> (custom-set-variables
>  '(ediff-custom-diff-options "-c --binary")
>  '(ediff-grab-mouse nil)
>  '(ediff-merge-split-window-function (quote split-window-horizontally))
>  '(ediff-patch-options "-f --binary")
>  '(ediff-split-window-function (quote split-window-horizontally))
>  '(ediff-trees-file-ignore-regexp
> "\\`\\(\\.?#.*\\|.*,v\\|.*~\\|CVS\\|_darcs\\|.*\\.elc\\)\\'")
>  '(ediff-window-setup-function (quote ediff-setup-windows-plain)))

If my init file contains just the last line as below:

    (custom-set-variables
     '(ediff-window-setup-function (quote ediff-setup-windows-plain)))

then I get the expected behaviour.

>> I expect the right behaviour with `emacs -Q'.  It doesn't matter what
>> configuration you have in your local area.
>
> It sometimes does.  With multiple frames your window manager settings
> might kick in.

0. IMPORTANT: REMOVE all customizations and start with emacs -Q
1. C-x C-f lisp/register.el
2. C-x C-w register-1.el
3. Make some changes here and there in register-1.el
4. M-x ediff-files RET register.el RET register-1.el 
5. Enusre that the control panel pops-up in a separate frame.
6. Keep pressing `n' 
7. The focus NEVER LEAVES the control panel on my machine.

Summary: M-x vc-ediff RET is buggy while M-x ediff-files RET is NOT
buggy.

Given the above experiment/result do you still think that window manager
is at play here.  My "gut" feeling says that vc-ediff is "forgetting"
some stuff.  (Remember vc-ediff is fairly a new arrival)

>> Btw, I am concerned that you might not have tried my recipe in first
>> place.  May be you should...
>
> Be assured I did.  With emacs -Q your scenario works without problems
> here.  But I remember that I had to set `ediff-grab-mouse' to nil with
> my one-frame setup precisely because of the problem you described.  I
> suppose it's related to my `mouse-autoselect-window' settings but didn't
> explore this issue any further.

If multiple-frames is problematic (on some machines) shouldn't the
default be modified to be just plain.

But, in that case, people like me, who are used to seeing the control
panel float to top-right, will complain that the defaults are changed
:-).

> martin