The Problem
Someone once lamented that sly was opening so many windows, and Emacs was placing them in awkward locations. To solve this, I tried to come up with some display-buffer-alist rules to place sly windows more predictably.
Keeping sly's new windows under control
- The source code gets the majority of the screen space.
- The REPL and debugger are allocated bottom-side windows in slots 0 and 1 respectively.
- Windows for documentation and the inspector are given right-side windows in slots 0 and 1 respectively.
When all the windows are active, it might look like this.

The Config
(use-package sly
:ensure t
:config
(let ((patterns '(("\\*sly-mrepl"
(display-buffer-in-side-window)
(side . bottom)
(slot . 0)
(window-height . 22))
("\\*sly-db"
(display-buffer-in-side-window)
(side . bottom)
(slot . 1))
("\\*sly-inspector"
(display-buffer-in-side-window)
(side . right)
(slot . 1)
(window-width . 80))
("\\*sly-description"
(display-buffer-in-side-window)
(side . right)
(slot . 0)
(window-width . 80)))))
(cl-loop for p in patterns
do (add-to-list 'display-buffer-alist p)))
(setopt inferior-lisp-program "/usr/bin/sbcl")
(setopt org-babel-lisp-eval-fn #'sly-eval))
The Teacher
Thanks to @protesilaos for explaining display-buffer-alist so well.
Original
This was originally posted on github.