A window configuration records the entire layout of one 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 section Frame Configurations.
window-min-height
, window-min-width
and
minibuffer-scroll-window
. An exception is made for point in the
current buffer, whose value is not saved.
current-window-configuration
. This configuration is restored in
the frame from which configuration was made, whether that frame is
selected or not. This always counts as a window size change and
triggers execution of the window-size-change-functions
(see section Hooks for Window Scrolling and Changes), because set-window-configuration
doesn't
know how to tell whether the new configuration actually differs from the
old one.
If the frame which configuration was saved from is dead, all this
function does is restore the three variables window-min-height
,
window-min-width
and minibuffer-scroll-window
.
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)))
save-excursion
also, 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 screen is now split again.
t
if object is a window configuration.
t
even if those
aspects differ.
The function equal
can also compare two window configurations; it
regards configurations as unequal if they differ in any respect, even a
saved point or mark.
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.
Go to the first, previous, next, last section, table of contents.