I have two parameters in my initialization files related to a similar requirement:
(add-to-list 'same-window-buffer-names "<em>nrepl</em>")
same buffer window names is a built-in Emacs function.
The other is a helper function that I use that uses an extension of sticky windows.
;; Toggle window dedication (defun toggle-window-dedicated () "Toggle whether the current active window is dedicated or not" (interactive) (message (if (let (window (get-buffer-window (current-buffer))) (set-window-dedicated-p window (not (window-dedicated-p window)))) "Window '%s' is dedicated" "Window '%s' is normal") (current-buffer)))
This is not a complete answer to your question, but hopefully a good starting point :)
source share