Controlling Buffer Placement

Protesilaos Stavrou (Prot) has a new heroic video. Heroic because it undertakes to describe the mechanism for controlling the placement of buffers. That is, where in the display environment should a buffer be displayed. That mechanism is complex so describing it usefully is a significant task.

For most of us, most of the time, the default behavior is fine but sometimes we would prefer something else to happen. This is Emacs so of course we can have it our way but even I was surprised at the level of control the user has.

The basic mechanism is an alist called display-buffer-alist. Prot describes this list as having entries of the form

;; ( BUFFER-MATCHING-RULE
;;   LIST-OF-DISPLAY-BUFFER-FUNCTIONS
;;   OPTIONAL-PARAMETERS)

The BUFFER-MATCHING-RULE is a regular expression or more complex expression that selects the buffers to which the LIST-OF-DISPLAY-BUFFER-FUNCTIONS and OPTIONAL-PARAMETERS should apply. Those functions and parameters can be selected from a very rich set and give very fine control over the buffer placement.

You’re going to have to watch Prot’s video for more details and even he doesn’t cover the full list of possibilities. He provides a link to his configuration for display-buffer-alist that demonstrate some of the advanced features but if you’re really interested in this you’ll probably have to consult the documentation.

The video is 29 minutes, 51 seconds so schedule some time. The video is a bit complex so schedule your watching for a time that you can focus on its content.

This entry was posted in General and tagged . Bookmark the permalink.