ediff-split-window-function horizontal==vertical?

Emacs 23.1.1 Ediff 2.81.2 on CentOs 6

Prior to any customization, Ediff would, by default, split the windows horizontally (one on top of the other).

I wanted them side by side so I tried adding the following lines to my .emacs

(setq ediff-split-window-function 'split-window-vertically)
(setq ediff-merge-split-window-function 'split-window-vertically)

This had no effect - the windows were still split horizontally. I also tried using the Emacs Customization interface for Ediff to get the vertical split by default - same story.

Note that I tried this in a comparison with two buffers that were vertically split. I also tried it with no files open in buffers and asked Ediff to compare two files - same result.

Then I tried specifying split-window-horizontally as the split window function for both ediff-split and ediff-merge.

(setq ediff-split-window-function 'split-window-horizontally)
(setq ediff-merge-split-window-function 'split-window-horizontally)

This caused the windows to split vertically (next to each other). This was also true when I commented out these lines and used the Emacs Customization interface to set these options.

And yes, I've seen this question but I don't want to eliminate horizontal splitting on a global basis - I just want Ediff to do it by default.

Am I losing my mind or has someone switched the meaning of "horizontal" and "vertical" (and by the way, I'm taking the definition of "vertical" and "horizontal" splitting from my copy of the O'Reilly book "Learning Gnu Emacs")?

Answers


I used emacs variable customization, invoked with C-h v ediff-split-window-function to change the value. After clicking Save for future sessions the following was written to my .emacs:

(custom-set-variables
...
 '(ediff-split-window-function (quote split-window-horizontally))
...)

And it does exactly what I want: putting the two buffers side-by-side. And yes, emacs uses horizontal/vertical in the opposite of what you had in mind. If you read this question again, you will see the explanation, others were confused, too.


Hitting "|" when you are in ediff mode with the 2 files loaded switches from horizontal to vertical. "?" gives a little ediff help menu. (I'm on Debian Wheezy with emacs 23.4+1-4)


While it doesn't quite answer your problem, you could also use a function to specify whether to split vertically or horizontally depending on window dimensions:

(setq ediff-split-window-function 'split-window-sensibly)

split-window-sensibly is built-in.


Need Your Help

How to read data from a repeated format of a large text file in MATLAB?

matlab file-io format text-files repeat

I want to read data of average saturation (%) for water as shown below. This data is a partial form of a large file, however the average water saturation (%) REPEATS itself in the given format only.

Debugging an IE crash

javascript internet-explorer

I have a web application that is working perfectly in Chrome and FireFox, yet is crashing in IE. Note, this is not a JavaScript error, but rather the iexplore.exe process actually crashes.