我使用以下内容。它修复了你的问题(我希望),以及防止Emacs首先分裂窗口。
;;; ------------------------------------------------------------------
;;; display-buffer
;; The default behaviour of `display-buffer' is to always create a new
;; window. As I normally use a large display sporting a number of
;; side-by-side windows, this is a bit obnoxious.
;;
;; The code below will make Emacs reuse existing windows, with the
;; exception that if have a single window open in a large display, it
;; will be split horisontally.
(setq pop-up-windows nil)
(defun my-display-buffer-function (buf not-this-window)
(if (and (not pop-up-frames)
(one-window-p)
(or not-this-window
(not (eq (window-buffer (selected-window)) buf)))
(> (frame-width) 162))
(split-window-horizontally))
;; Note: Some modules sets `pop-up-windows' to t before calling
;; `display-buffer' -- Why, oh, why!
(let ((display-buffer-function nil)
(pop-up-windows nil))
(display-buffer buf not-this-window)))
(setq display-buffer-function 'my-display-buffer-function)
有趣的是,当我的Emacs框架的宽度大于它是高,Emacs的由defualt打开的窗口并排侧... – lukstafi
我现在做'CX 3',但我敢肯定,必须有一个方式使它在Emacs默认为Python-IDE – Chirag
@lukstafi ...这不是我所观察到的。 – Chirag