Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to get Ediff to not open its navigation interface in an external window?

Tags:

emacs

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?

like image 579
Rob Avatar asked Nov 05 '09 13:11

Rob


4 Answers

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.

like image 175
David J. Liszewski Avatar answered Nov 08 '22 00:11

David J. Liszewski


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)))))
like image 32
stsquad Avatar answered Nov 08 '22 01:11

stsquad


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.

like image 16
viam0Zah Avatar answered Nov 07 '22 23:11

viam0Zah


(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

like image 7
kjfletch Avatar answered Nov 07 '22 23:11

kjfletch