Skip to content
bmag edited this page Feb 17, 2015 · 13 revisions

Introduction

Purpose offers a new way to manage the display of windows, and was originally inspired by E2WM.

Motivation and aim

Once upon a time, I worked on some parts of a large project. I found myself using all kinds of buffers - python files, python interpreter, bash terminal, grep, dired, ibuffer. When I navigated the code, Emacs opened all sorts of buffers in all sorts of windows, and when I finally discovered what variable or function I needed, the window layout was messed up and I had to look for the original file I was working on.
What I was missing was a way to limit which buffers can be displayed in which window. E2WM helped me somewhat, but wasn't flexible enough. Enter Purpose.

What Purpose does, is assign a purpose to each window and each buffer. This way, any window can display only a certain kinds of buffers. Also, Purpose lets the user decide which windows can be used for any purpose, and which windows should stick to one purpose.
What this all should mean, if Purpose is successful, is less time spent fighting Emacs over the window layout and where to display buffers, a pleasant user experience and more time for fun or important work.

Purpose is not meant to be as extensive as E2WM. It has three main goals:

  1. provide an easy and reliable way for the user to maintain a consistent window layout

  2. provide a framework for extensions that make use of the window layout

  3. hopefully, be a step towards IDE-like packages in the future (seriously)

Insallation and setup

Purpose is available at MELPA, so you should install it with Emacs' package manager.
To turn on Purpose manually, open Emacs and type the command M-x purpose-mode.
To turn on Purpose automatically when Emacs starts, add the following line to your init file:

(purpose-mode)

If you prefer to download Purpose straight from GitHub, add this to your init file (before calling purpose-mode):

(add-to-list `load-path "/path/to/purpose")
(require 'purpose)

Usage

Purpose makes Emacs aware of purposes when deciding where to display a buffer, and provides a handful of useful commands. See Usage.

Configuration

You can configure what purposes Purpose recognizes. See Purpose Configuraion.

Extensions

Purpose is designed to be easily extended, both for the benefit of users and in the hope of enabling flexible window management for IDE-like packages. See Extensions.

Internals

For an explanation of how Purpose works inside, see Internals.

Clone this wiki locally