Go to the first, previous, next, last section, table of contents.


Basic Concepts of Emacs Windows

A window in Emacs is the physical area of the screen in which a buffer is displayed. The term is also used to refer to a Lisp object that represents that screen area in Emacs Lisp. It should be clear from the context which is meant.

Emacs groups windows into frames. A frame represents an area of screen available for Emacs to use. Each frame always contains at least one window, but you can subdivide it vertically or horizontally into multiple nonoverlapping Emacs windows.

In each frame, at any time, one and only one window is designated as selected within the frame. The frame's cursor appears in that window. At any time, one frame is the selected frame; and the window selected within that frame is the selected window. The selected window's buffer is usually the current buffer (except when set-buffer has been used). See section The Current Buffer.

For practical purposes, a window exists only while it is displayed in a frame. Once removed from the frame, the window is effectively deleted and should not be used, even though there may still be references to it from other Lisp objects. Restoring a saved window configuration is the only way for a window no longer on the screen to come back to life. (See section Deleting Windows.)

Each window has the following attributes:

Users create multiple windows so they can look at several buffers at once. Lisp libraries use multiple windows for a variety of reasons, but most often to display related information. In Rmail, for example, you can move through a summary buffer in one window while the other window shows messages one at a time as they are reached.

The meaning of "window" in Emacs is similar to what it means in the context of general-purpose window systems such as X, but not identical. The X Window System places X windows on the screen; Emacs uses one or more X windows as frames, and subdivides them into Emacs windows. When you use Emacs on a character-only terminal, Emacs treats the whole terminal screen as one frame.

Most window systems support arbitrarily located overlapping windows. In contrast, Emacs windows are tiled; they never overlap, and together they fill the whole screen or frame. Because of the way in which Emacs creates new windows and resizes them, not all conceivable tilings of windows on an Emacs frame are actually possible. See section Splitting Windows, and section The Size of a Window.

See section Emacs Display, for information on how the contents of the window's buffer are displayed in the window.

Function: windowp object
This function returns t if object is a window.


Go to the first, previous, next, last section, table of contents.