In emacs -Q, I strike C-x 4 b which invoke (switch-to-buffer-other-window) and display the other window vertically as

enter image description here

I reference it's source code

(defun switch-to-buffer-other-window (buffer-or-name &optional norecord)
   (list (read-buffer-to-switch "Switch to buffer in other window: ")))
  (let ((pop-up-windows t))
    (pop-to-buffer buffer-or-name t norecord)))

It apply the procedure of pop-up-window.

How could use "C-x 4 b" pop up the other window which display horizontally instead of vertically?

  • The procedure is pop-to-buffer. pop-up-windows is a variable. Use C-h f and C-h v. – Drew Apr 7 at 4:33
  • I want "C-x 4 b" to display the other window to the right not below. @Drew – Calculus Apr 7 at 5:38
  • That's the default behaviour here (emacs -Q), showing the buffer to the right. – Swedgin Apr 7 at 13:52
  • No, it does not. @Swedgin – Calculus Apr 8 at 3:09

Try setting the value of split-width-threshold as it works for me when I have wide frames: switching to a buffer in another window splits to the right.

| improve this answer | |

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.