tags:

views:

182

answers:

6

Not being using Emacs all that long (v23, windows) and just discovered M-x ediff. Fantastic. Although I'm not to keen on the fact it opens its help/navigation in a separate frame/window, meaning that if I lose focus to that window, the single key shortcuts don't work.

For example as soon as I press ? to expand the window, it shifts over top of my current window, so I have to pick up my mouse and move it to another screen. Then if I lose focus to that window and press p / n / j or any other key to work with the diff, it inserts it into my document. So i have to undo, grab mouse, focus to other window, and repeat.

Is there any way to configure these options to show in a split instead?

+12  A: 

I didn't know how to do it but it is usually easy to learn with Emacs. First I asked about ediff customizations:

M-x customize-apropos
ediff

I saw there is something called Ediff Window Setup Function which takes the values Multi Frame, Single Frame, or Other Function. Mine was set to Multi Frame and changed it to Single Frame and saved it for future sessions. And Voila! as they say somewhere.

unhillbilly
+2  A: 

Simply:

 (setq ediff-window-setup-function 'ediff-setup-windows-plain)

M-x describe-variable ediff-window-setup-function will enlighten you further.

For reference my ediff customisation is fairly simple:

(if (locate-library "ediff")
    (progn
      (autoload 'ediff-files "ediff")
      (autoload 'ediff-buffers "ediff")

       (eval-after-load "ediff" '(progn
       (message "doing ediff customisation")
     (setq diff-switches               "-u"
    ediff-custom-diff-options   "-U3"
    ediff-split-window-function 'split-window-horizontally
    ediff-window-setup-function 'ediff-setup-windows-plain)

     (add-hook 'ediff-startup-hook 'ediff-toggle-wide-display)
     (add-hook 'ediff-cleanup-hook 'ediff-toggle-wide-display)
     (add-hook 'ediff-suspend-hook 'ediff-toggle-wide-display)))))
stsquad
+4  A: 

From chapter Window and Frame Configuration in Ediff User's Manual:

The following variable controls how windows are set up:

ediff-window-setup-function

The multiframe setup is done by the ediff-setup-windows-multiframe function, which is the default on windowing displays. The plain setup, one where all windows are always in one frame, is done by ediff-setup-windows-plain, which is the default on a non-windowing display (or in an xterm window). In fact, under Emacs, you can switch freely between these two setups by executing the command ediff-toggle-multiframe using the Minibuffer of the Menubar.

Török Gábor
+2  A: 
(custom-set-variables    
  ...
 '(ediff-window-setup-function (quote ediff-setup-windows-plain))
  ...)

Not that you would set the variable this way, but it allows you to know these things:

  • The variable you are interested in is ediff-window-setup-function
  • The value it needs to be set to is ediff-setup-windows-plain
  • You can configure the variable from customize: M-x customize-group RET ediff-window

    Ediff Window Setup Function: Menu Single Frame

kjfletch
A: 

I just noticed I posted the above question "anonymously" and navigated away from the page to log in. I now noticed when I tried to mark it as an answer that I cannot get back to it :). Any ideas how to close this question as answered now? :)

prevailrob
Try again now? I'd be ever so happy if you picked an answer. :)
unhillbilly
A: 

Note: you can avoid using the mouse to go back to the ediff control window by using M-x other-frame. Also found on C-x 5 o.

Trey Jackson