1

With the following code, emacs split sides windows like:

;; -------------------------------------
;; |                             |  *  |
;; |                             |  h  |
;; |                             |  e  |
;; |         Main Window Area    |  l  |
;; |                             |  p  |
;; |                             |  *  |
;; |                             |     |
;; |_____________________________|_____|
;; |        *shell*                    |
;; |                                   |
;; |___________________________________|

How to split like this below instead?

;; -------------------------------------
;; |                             |  *  |
;; |                             |  h  |
;; |                             |  e  |
;; |         Main Window Area    |  l  |
;; |                             |  p  |
;; |                             |  *  |
;; |                             |     |
;; |_____________________________|     |
;; |        *shell*              |     |
;; |                             |     |
;; |_____________________________|_____|

Display code:

   (setq display-buffer-alist nil)

   (add-to-list 'display-buffer-alist
                 ;; put help/info buffer in a side window;
                 ;; it must be on the right-hand side and in slot 0;
                 ;; the window-width must be 82;
                 ;; the window is not deleted when you call C-x 1.
                 '("^\\*\\(Help\\|helpful .*\\|Apropos\\)\\*"
                   (display-buffer-in-side-window)
                   (side . right)
                   (window-width . 82) ; width of 80 plus 2 for window edges.
                   (window-parameters . (no-delete-other-windows . t))))

    (add-to-list 'display-buffer-alist
                 '("^\\*\\(e?shell\\|compilation\\)\\*"
                   display-buffer-in-side-window
                   (side . bottom)
                   (window . root)
                   (window-height . 0.25)
                   (window-parameters . (no-delete-other-windows . t))))
0

1 Answer 1

1

C-hig (elisp)Side Window Options and Functions:

-- User Option: window-sides-vertical If non-‘nil’, the side windows on the left and right of a frame occupy the frame’s full height. Otherwise, the side windows on the top and bottom of the frame occupy the frame’s full width.

So:

(setq window-sides-vertical t)

Or if it doesn't need to be a "side window":

+               display-buffer-at-bottom
-               display-buffer-in-side-window
-               (side . bottom)
-               (window . root)
2
  • thanks, but I'd prefer side window instead of a normal window for its nice features.
    – RNA
    Commented Jul 20, 2023 at 13:32
  • Answer updated.
    – phils
    Commented Jul 20, 2023 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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