Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Inspirations

Akira Komamura edited this page Jun 8, 2018 · 4 revisions

Table of contents

Introduction

There are several packages related to workspace management in Emacs. To name a few, perspective.el, eyebrowse, and workgroups are such ones. Some of them seem to be useful, while others are not. They tackle one or two of the following problems: session persistence and multi-tasking.

As for session persistence, desktop.el is a built-in mechanism for Emacs. There are other solutions such as workgroups and workgroups2. For simple use cases, desktop.el seems to work. It is not a perfect solution, and workgroups 1/2 may fill in the need for a more thorough persistence, but I have not looked into them.

The remaining problem is multi-tasking. Emacs allows you to handle multiple different tasks simultaneously inside a single session, but it can easily get messed up with a hundred of buffers. In this document, I will review of some packages I found relevant.

EXWM

Emacs X Window Manager (EXWM) is a tiling X window manager that can be seamlessly integrated into Emacs. It treats X windows as Emacs buffers and displays each X window in an Emacs window. It does not manage layouts of Emacs windows, but manages X windows, and it supports multiple workspaces as an X window manager. Each workspace in EXWM is just an Emacs frame, and EXWM supports multiple monitors through XRandR. This is an awesome solution, and I have been using it for months.

However, one problem with EXWM is lack of named workspaces. EXWM is based on numbered workspaces. I really dislike the idea. I don’t remember things with numbers. I want to use names to refer to things.

I was once a user of XMonad, a tiling window manager written in Haskell. It allowed configuring workspaces with human-friendly names, and I miss the feature.

As there is no other solution like EXWM, i.e. a window manager that integrates with Emacs, at present, I probably should use it as a daily driver, and it should add support for named workspaces. Fortunately, because workspaces in EXWM are frames in Emacs, it can be implemented as an additional layer for frame management in Emacs.

framegroups

framegroups.el is a solution for frame management in Emacs. I found it in a Reddit thread that announces frame-purpose.el. It does basically what I want. It allows adding a human-friendly name to each frame, switching to another frame by name, and hooks on frame creation and renaming. However, for a couple of reasons, I wanted to rewrite its core to suit my purposes.

Note that each workspace should be assigned a frame. Eyebrowse supports named workspaces, but inside a single frame. This does not work well with winner-mode, which implements undos of window configuration. Therefore such solutions as eyebrowse will be neglected. Framegroups gets it right.

frame-purpose

frame-purpose.el is a new package for session management. It does a job of adding a per-frame buffer filter function to each frame created by it. For example, you can create a frame which displays only Emacs Lisp buffers so that you can focus on writing code in the language. This seems to be a promising solution.

It is not a comprehensive solution that can constitute an entire frame-oriented workflow. I find its simplicity of doing one thing being useful and effective, and I need an integration to use it inside my workflow.

state.el

state.el has nothing to do with frames, but it is a library for workflow in Emacs. I found it in a blog post (Japanese) written by rubikitch. I don’t find the package itself useful. I thought about my workflow using such a model, but the same functionality probably can be implemented in terms of a bunch of functions and keybindings. Furthermore, because winner-mode retains history per frame, it would be better to switch the frame when you switch the context. state.el doesn’t provide any support for frames. In conclusion, this package is an inspiration, but not an implementation I am likely to use regularly.

Other relevant/similar packages