17

In general, I dislike frames. Right now, I'm using

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

To ensure that ediff does not create a frame when it starts.

However, certain commands, like ediff-show-registry still open up new frames.

Is there any way I can completely disable the creation of frames in ediff?

PythonNut
  • 10,243
  • 2
  • 29
  • 75
  • How about modifying `ediff-skip-unsuitable-frames`, or commenting that out entirely within `ediff-show-registry` -- e.g., comment out: `(ediff-skip-unsuitable-frames 'ok-unsplittable)`? – lawlist Oct 02 '15 at 03:43
  • 5
    While you are at it, consider searching the source of the `ediff`-family of libraries for `(make-frame` and you'll find a few places that need fixing to suit your preferences. Your request is certainly reasonable, and would merit (in my opinion) a feature request to the author and/or Emacs team -- most people will assume `ediff-setup-windows-plain` should apply across the board without the various `make-frame` exceptions. – lawlist Oct 02 '15 at 03:49

1 Answers1

3

There is an internal predicate in ediff-init.el, called ediff-window-display-p. When I redefined it (after loading ediff, of course) like so, everything works in a single frame, including the function you mentioned as a problem:

(defun ediff-window-display-p () nil)

I do agree with @lawlist that this is a nice feature request -- to fix ediff-window-setup-function.

cyberbisson
  • 887
  • 1
  • 6
  • 17
  • 3
    This might be better written `(advice-add 'ediff-window-display-p :override #'ignore)`, which can more easily be reversed with `advice-remove` (plus it doesn't require loading ediff first). – npostavs Apr 13 '19 at 02:13
  • @npostavs great! Thanks for the smarter code! – cyberbisson Apr 13 '19 at 13:01
  • I tried this, but it unfortunately caused ediff to stop using my custom window setup function. – tboyce12 Apr 16 '19 at 23:42
  • @tboyce12 That's confusing... why do you have a custom window set up function if you don't want new windows (i.e. frames) to show? What does the function do? – cyberbisson Apr 17 '19 at 02:35
  • I do want new windows, but not new frames. The default `ediff-setup-windows-plain` takes over the whole frame -- I want to keep my "context" windows open (eg notes and other files). So I wrote a custom window setup function (uses custom display-buffer powered by ace-window to choose where to maybe split windows and display new buffers). It seems that when Ediff boots up it checks this `ediff-window-display-p` and if false, bypasses the custom window setup function and uses `ediff-setup-windows-plain`. So for my custom setup, I'll either avoid `ediff-show-registry`, or write custom command. – tboyce12 Apr 17 '19 at 18:50