Popwin doesn't have a customizable way to achieve what you ask for, but we can hack it by overriding the function popwin:popup-buffer
. Essentially, we replace the call to popwin:create-popup-window
with code that displays the popup buffer in a new split:
(let* ((orig-window (selected-window))
(new-window (split-window orig-window nil 'below)))
(set-window-buffer new-window buffer)
(list orig-window new-window nil))
This piece of code returns a "master window", which is the original window, a "popup window", which is the window used for the popup buffer, and a "window map", which is nil. In the original version, popwin:create-popup-window
calls popwin:replicate-window-config
and returns the result as the "window map". In turn, popwin:replicate-window-config
returns nil if the frame has more than one window (maybe a bug), otherwise it returns some other value.
This answer is more a proof-of-concept than a polished solution, but of course you can improve on it if you find it necessary.
(defun* popwin:popup-buffer (buffer
&key
(width popwin:popup-window-width)
(height popwin:popup-window-height)
(position popwin:popup-window-position)
noselect
dedicated
stick
tail)
"Show BUFFER in a popup window and return the popup window. If
NOSELECT is non-nil, the popup window will not be selected. If
STICK is non-nil, the popup window will be stuck. If TAIL is
non-nil, the popup window will show the last contents. Calling
`popwin:popup-buffer' during `popwin:popup-buffer' is allowed. In
that case, the buffer of the popup window will be replaced with
BUFFER."
(interactive "BPopup buffer:\n")
(setq buffer (get-buffer buffer))
(popwin:push-context)
(run-hooks 'popwin:before-popup-hook)
(multiple-value-bind (context context-stack)
(popwin:find-context-for-buffer buffer :valid-only t)
(if context
(progn
(popwin:use-context context)
(setq popwin:context-stack context-stack))
(let ((win-outline (car (popwin:window-config-tree))))
(destructuring-bind (master-win popup-win win-map)
(let ((size (if (popwin:position-horizontal-p position) width height))
(adjust popwin:adjust-other-windows))
;; (popwin:create-popup-window size position adjust) ; <-- original line
(let* ((orig-window (selected-window)) ; <-- modifications
(new-window (split-window orig-window nil 'below))) ; <--
(set-window-buffer new-window buffer) ; <--
(list orig-window new-window nil)) ; <--
)
(setq popwin:popup-window popup-win
popwin:master-window master-win
popwin:window-outline win-outline
popwin:window-map win-map
popwin:window-config nil
popwin:selected-window (selected-window)))
(popwin:update-window-reference 'popwin:context-stack :recursive t)
(popwin:start-close-popup-window-timer))
(with-selected-window popwin:popup-window
(popwin:switch-to-buffer buffer)
(when tail
(set-window-point popwin:popup-window (point-max))
(recenter -2)))
(setq popwin:popup-buffer buffer
popwin:popup-last-config (list buffer
:width width :height height :position position
:noselect noselect :dedicated dedicated
:stick stick :tail tail)
popwin:popup-window-dedicated-p dedicated
popwin:popup-window-stuck-p stick)))
(if noselect
(setq popwin:focus-window popwin:selected-window)
(setq popwin:focus-window popwin:popup-window)
(select-window popwin:popup-window))
(run-hooks 'popwin:after-popup-hook)
popwin:popup-window)