FORCE-OTHER-WINDOW is ignored." (or (get-buffer-window buffer) (if (one-window-p) (let ((new-win (if (> (window-width) 100) (split-window-horizontally) (split-window-vertically)))) (set-window-buffer new-win buffer) new-win) (let ((new-win (get-lru-window))) (set-window-buffer new-win buffer) new-win)))) use display-buffer-alist instead of display-buffer-function if the following line won't work (setq display-buffer-function 'display-new-buffer)
This function returns the window which holds BUFFER. If the current buffer contains more than one window, select BUFFER in the least recently used window. If the current window (before the split) is more than 100 columns wide, split horizontally(left/right), else split vertically(up/down).
If it's not visible and there's only one window, split the current window and select BUFFER in the new window. FORCE-OTHER-WINDOW is ignored." (or (get-buffer-window buffer) (if (one-window-p) (let ((new-win (if (> (window-width) 100) (split-window-horizontally) (split-window-vertically)))) (set-window-buffer new-win buffer) new-win) (let ((new-win (get-lru-window))) (set-window-buffer new-win buffer) new-win)))) use display-buffer-alist instead of display-buffer-function if the following line won't work (setq display-buffer-function 'display-new-buffer) по (defun display-new-buffer (buffer force-other-window) "If BUFFER is visible, select it.