Window management

Neomacs manage windows using frame-root buffers -- the window tree in Neomacs is itself a buffer! Selecting windows are implemented by moving focus in the frame-root buffer. Creating and removing windows are implemented by editing the frame-root buffer. This is one of the many nice things about computing environment inside a structural editor, which wouldn't be possible in, say, a text editor.

Window management commands

Selecting a different window:

Command (C-x o): other-window ()
Focus another buffer in cyclic order in current frame.
Command: prev-other-window ()
Focus another buffer in reverse cyclic order in current frame.

Deleting windows:

Command (C-x 0): close-window (&optional (buffer (current-buffer)))
Close the window which displays BUFFER.
If BUFFER is the only displayed buffer in a frame, this functions do nothing instead, because deleting it would break window management.
Command (C-x 1): delete-other-windows (&optional (buffer (current-buffer)))
Make BUFFER fill its frame.

Splitting windows:

Command (C-x 3): split-window-right (&optional (buffer (replacement-buffer)))
Split a window to the right and display BUFFER in it.
Command (C-x 2): split-window-below (&optional (buffer (replacement-buffer)))
Split a window to the bottom and display BUFFER in it.

Echo area

Neomacs frames display a small buffer at the bottom to display messages.

Function: message (control-string &rest format-arguments)
Echo and log a message in *Messages* buffer.
If CONTROL-STRING is a string, format it with FORMAT-ARGUMENTS and echo it.
CONTROL-STRING can also be a list of DOM nodes (elements or text-nodes), which are displayed and logged. FORMAT-ARGUMENTS must be nil in this case.
Variable: *message-log-max*
Maximum number of lines to keep in the *Messages* buffer.
If nil, disable message logging. If t, log messages but don't truncate *Messages* buffer.

Frame-root buffers

Frame-root buffers are buffers with frame-root-mode enabled and manages Neomacs windows, which in turn displays other buffers. frame-root-mode expect buffer content to follow certain conventions:

CSS class: content
Elements of this class correspond one-to-one to buffers displayed in this frame. Such element must have a buffer CSS attribute, which is the ID of the buffer being displayed.
CSS class: main
This CSS class must be used together with the content CSS class. It marks the corresponding buffer as the main buffer for the containing window. A buffer or minibuffer element must have exactly one descendant with this class.
CSS class: buffer
A window for displaying a full-sized buffer. It must have exactly one main descendant. It may have multiple content descendants, the ones without main CSS class display child buffers.
CSS class: vertical-child-container
Must be a child of a buffer element and must contain main element. Including an vertical-child-container element in a buffer element allows it to support displaying vertically-split child buffers (i.e. on the left or right side), which are inserted as children of the vertical-child-container element.
CSS class: minibuffer
A window for displaying small buffers, used for echo-areas and minibuffers without completion lists (note that minibuffers with completion lists are normally displayed in buffer elements).
CSS attribute: selectable
Window management commands may select an element only if this attribute is present.
CSS class: vertical
Vertical split container. Children should be buffer elements, which are displayed side-by-side.
CSS class: horizontal
Horizontal split container. Children should be buffer or minibuffer elements, which are displayed row-by-row.

Window decorations

Besides content elements that display buffer contents, buffer and minibuffer elements can have other children, which are rendered normally by the frame-root buffer. These elements are used to draw window decorations like header lines.

Standard generic function: window-decoration-aux (buffer)
Create window-decoration for BUFFER.
Should return a div with buffer or minibuffer CSS class, which contains a single descendant with both main and content CSS class. This descendant must have a buffer CSS attribute with the id of BUFFER as its value.
Child buffers can be included via other elements with content CSS class.
Function: update-window-decoration-field (buffer name text)
Update the element with CSS class NAME in BUFFER's window decoration.
There must be exactly one element with NAME as CSS class, whose content is replaced with TEXT. If BUFFER is not displayed, this function does nothing.
Standard generic function, setf-able: window-decoration (object)