Skip to content
Bar edited this page Feb 13, 2016 · 6 revisions

Table of Contents

Purpose lets you save and load the window layout of frames in a simple way.

Changing window layout

To add, remove or resize windows, use regular Emacs commands (split-window-below, enlarge-window, etc.).

Changing the purpose of a window

You can forcefully change the purpose of a window with the following commands:

  • purpose-set-window-purpose: change the purpose of the current window. The window's buffer is changed accordingly.
  • switch-buffer-without-purpose: bound to C-u C-x b. Use this to switch a window's buffer while ignoring the current purpose of any window. *-other-window and *-other-frame variants also exist.

Deleting windows

In addition to regular Emacs commands, you can use the following functions to delete windows:

  • purpose-delete-non-dedicated-windows: bound to C-c , 1. Deletes every window that is not purpose-dedicated or buffer-dedicated.
  • purpose-delete-window-at-bottom: deletes the window at the bottom of the screen. Note that if a window doesn't span the entire width of the screen, it is not considered as the "bottom" window. This is because you may have more than one bottom window, and then the definition of "bottom" window becomes ambiguous and non-trivial. *-top *-left and *-right variants also exist.

Saving and loading window layouts

When Purpose save a window layout, it saves the position, size, purpose and purpose-dedication state of each window.

  • purpose-save-window-layout: save to file the window layout of the current frame
  • purpose-load-window-layout: load from file a window layout and make it the layout of the current frame
  • purpose-save-frame-layout: save to file the window layouts of all frames
  • purpose-load-frame-layout: delete all frames, load a list of window layouts from file and make new frames accordingly
  • purpose-save-window-layout-file: same as purpose-save-window-layout, but you choose the file directly, instead of choosing a layout name. Usually purpose-save-window-layout is preferred.
  • purpose-load-window-layout-file: same as purpose-save-window-layout, but you choose the file directly. Usually purpose-load-window-layout is preferred.
  • purpose-save-frame-layout-file
  • purpose-load-frame-layout-file

Resetting window layout

Purpose lets you reset the window layout to the previous layout you loaded.

  • purpose-reset-window-layout: reload the latest window layout you used
  • purpose-reset-frame-layout: reload the latest frame layout you used