TransWikia.com

Prevent other-window from choosing side window

Emacs Asked by J3RN on December 19, 2021

I have recently started using buffer-display-alist to sensibly place windows within a frame. Typically, I’ll have one or two windows of code buffers that I actively work in and a bottom "side window" that hosts shell and test buffers. My configuration looks like this:

(custom-set-variables
 '(display-buffer-alist
   (quote
    (("\*eshell"
      (display-buffer-in-side-window)
      (side . bottom)
      (slot . -1))
     ("\*shell"
      (display-buffer-in-side-window)
      (side . bottom)
      (slot . -1))
     ...

I had a now-lost configuration that prevented other-window (i.e. C-x o) from ever setting the bottom "side window" as the active window. If I wanted to interact with that window, I would click into it with the mouse or use some other command (e.g. windmove-*).

How can I accomplish this?

One Answer

I stumbled upon the answer in the documentation for Frame Layouts with Side Windows.

Ultimately, I needed to set the no-other-window window parameter in my side windows. display-buffer-in-side-window accepts a list of arbitrary window parameters to be set on the resultant window by way of a window-parameter alist element.

My resulting code/configuration looks like this:

(custom-set-variables
 '(display-buffer-alist
   '(("\*eshell" display-buffer-in-side-window
      (side . bottom)
      (slot . -1)
      (window-parameters . ((no-other-window . t)))))))

Answered by J3RN on December 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP