2

I have a shell buffer that's a good candidate for a side window: I also regularly use an org buffer, that's always good to have around.

https://www.gnu.org/software/emacs/draft/manual/html_node/elisp/Side-Windows.html

I can't figure the keyboard shortcuts to:

  • make a side window
  • remove the side window
  • focus in to the side window
  • 1
    Your question appears to be: what keys can you use to (1) show/create a side window, (2) hide/delete a side window, and (3) select a side window. – Drew Jun 19 '18 at 18:40
  • that's right mr d – american-ninja-warrior Jun 19 '18 at 19:17
  • Make a side window: (split-window (selected-window) nil 'right nil). Remove the side window: (delete-window (window-in-direction 'right)). Focus in to the side window: (select-window (window-in-direction 'right)). See my previous answer regarding how to display a *shell* buffer in the desired window: emacs.stackexchange.com/a/28924/2287 . You may wish to set up your own keyboard shortcuts for commonly used functions. For example, I like F11 to delete-window with no argument, and F12 to delete-other-windows with no argument. – lawlist Jun 20 '18 at 14:21
  • @lawlist the elisp you mentioned creates regular splits. This question refers to the "original" side windows. In the emacs documentation it says "Note also that delete-other-windows cannot make a side window the only window on its frame ". Since your side window can be made the sole window, it looks to me like "(split-window (selected-window) nil 'right nil)" doesn't make a real side window – american-ninja-warrior Jul 9 '18 at 17:21
2

There are no "built in" shortcuts for this. This answer uses lisp (which can be executed with Meta-:) to create a side window. Focussing on the side window and pressing C-x 1 - emacs refuses to make the side window the sole window. So I guess thats what we want.

Right now I'm doing

Meta-:
(display-buffer-in-side-window (get-buffer "*shell*") '((side . bottom)))
enter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.