I'm trying to write a simple function to divide the Emacs frame into four quadrants. Once I get the splitting to work, each window will have Dired for a different directory.
The splitting isn't giving the results I want, because I can't move point to the window I want to split.
Here's what I have for the window splitting:
(defun split-into-quadrants () "Manipulate windows" (interactive)
(delete-other-windows)
(split-window-vertically)
(split-window-horizontally)
(next-window)
(next-window)
(split-window-horizontally)
(next-window)
(next-window))
The splits work fine. next-window
has no effect.
If I issue these commands interactively, Emacs does exactly what I want. But when I execute the function, point remains in the first window and I end up with three windows in the top half of the frame and one in the bottom half. What am I missing?
next-window
doesn't select a window; it just returns the window object for the next window. You're not doing anything with the return values.