Next: Window Configuration Hook, Previous: Resizing Windows, Up: Windows [Contents][Index]
A window configuration records the entire layout of a frame—all windows, their sizes, which buffers they contain, what part of each buffer is displayed, and the values of point and the mark. You can bring back an entire previous layout by restoring a window configuration previously saved.
If you want to record all frames instead of just one, use a frame configuration instead of a window configuration. See Frame Configurations.
Use the window configuration hook whenever you need to dynamicly adapt to window configuration changes. See Window Configuration Hook.
This function returns a new object representing the current window configuration of frame, namely the number of windows, their sizes and current buffers, which window is the selected window, and for each window the displayed buffer, the display-start position, and the positions of point and the mark. An exception is made for point in the current buffer, whose value is not saved.
frame defaults to the selected frame.
This function restores the configuration of SXEmacs’s windows and
buffers to the state specified by configuration. The argument
configuration must be a value that was previously returned by
current-window-configuration
.
This function always counts as a window size change and triggers
execution of the window-size-change-functions
. (It doesn’t know
how to tell whether the new configuration actually differs from the old
one.)
Here is a way of using this function to get the same effect
as save-window-excursion
:
(let ((config (current-window-configuration))) (unwind-protect (progn (split-window-vertically nil) …) (set-window-configuration config)))
This special form records the window configuration, executes forms
in sequence, then restores the earlier window configuration. The window
configuration includes the value of point and the portion of the buffer
that is visible. It also includes the choice of selected window.
However, it does not include the value of point in the current buffer;
use save-excursion
if you wish to preserve that.
Don’t use this construct when save-selected-window
is all you need.
Exit from save-window-excursion
always triggers execution of the
window-size-change-functions
. (It doesn’t know how to tell
whether the restored configuration actually differs from the one in
effect at the end of the forms.)
The return value is the value of the final form in forms. For example:
(split-window) ⇒ #<window 25 on control.texi>
(setq w (selected-window)) ⇒ #<window 19 on control.texi>
(save-window-excursion
(delete-other-windows w)
(switch-to-buffer "foo")
'do-something)
⇒ do-something
;; The frame is now split again.
This function returns t
if object is a window configuration.
Primitives to look inside of window configurations would make sense, but none are implemented. It is not clear they are useful enough to be worth implementing.
Next: Window Configuration Hook, Previous: Resizing Windows, Up: Windows [Contents][Index]