[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10. Window Configuration Rings

This package provides lightweight support for circular rings of window configurations. A window configuration is the layout of windows and associated buffers within a frame. There is always at least one configuration on the ring, the current configuration. You can create new configurations and cycle through the layouts in either direction. You can also delete configurations from the ring (except the last one of course!). Window configurations are named, and you can jump to and delete named configurations.

Window configuration rings are frame specific. That is, each frame has its own ring which can be cycled through independently of other frames.

You are always looking at the current window configuration for each frame, which consists of the windows in the frame, the buffers in those windows, and point in the current buffer. As you run commands such as C-x 4 b, C-x 2, and C-x 0 you are modifying the current window configuration. When you jump to a new configuration, the layout that existed before the jump is captured, and the ring is rotated to the selected configuration. Window configurations are captured with current-window-configuration, however winring also saves point for the current buffer.

To use, add the following to your initialization file:

 
  (winring-initialize)

Note that by default, this binds the winring keymap to the C-x 7 prefix, but you can change this by setting the value of winring-keymap-prefix, before you call winring-initialize.

The following commands are defined:

C-x 7 n

Create a new window configuration. The new configuration will contain a single buffer, the one named in the variable winring-new-config-buffer-name.

With C-u, winring prompts for the name of the new configuration. If you don’t use C-u the function in winring-name-generator will be called to get the new configuration’s name.

C-x 7 2

Create a duplicate of the current window configuration. C-u has the same semantics as with C-x 7 c.

C-x 7 j

Jump to a named configuration (prompts for the name).

C-x 7 0

Kill the current window configuration and rotate to the previous layout on the ring. You cannot delete the last configuration in the ring. With C-u, prompts for the name of the configuration to kill.

C-x 7 o

Go to the next configuration on the ring.

C-x 7 p

Go to the previous configuration on the ring.

Note that the sequence ‘C-x 7 o C-x 7 p’ is a no-op; it leaves you in the same configuration you were in before the sequence.

C-x 7 r

Rename the current window configuration.

C-x 7 b

Submit a bug report on winring.

C-x 7 v

Echo the winring version.

As mentioned, window configuration names can be displayed in the modeline. The default value of winring-show-names is currently nil by default. Set it to t to activate. If you don’t like the position in the modeline where winring names are shown, you can change this by passing in your own modeline hacker function to winring-initialize.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.1 History

A long long time ago there was a package called ‘wicos’ written by Heikki Suopanki, which was based on yet another earlier package called ‘screens’ also written by Suopanki. This in turn was based on the Unix tty session manager ‘screen’ (unrelated to Emacs) by Oliver Laumann, Juergen Weigert, and Michael Schroeder.

Wicos essentially provided fancy handling for window configurations. I liked the basic ideas, but wicos broke with later versions of Emacs and XEmacs. I re-implemented just the functionality I wanted, simplifying things in the process, and porting the code to run with XEmacs 19 and 20, and Emacs 20 (I don’t know if winring works in Emacs 19.34).

Wicos used the M-o prefix which I’ve recently changed to C-x 7 as the default, by suggestion of RMS. Wicos also had some support for multiple frames, and saving configurations on all visible frames, but it didn’t work too well, and I like frame independent rings better.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.2 Related Packages

I know of a few other related packages:

Please feel free to email me if my rendition of history, or my explanation of the related packages, is inaccurate.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Aidan Kehoe on December 27, 2016 using texi2html 1.82.