When you compile something in Slime it can create a number of temporary buffers, which it opens all over the place. I assume that it opens these buffers in the current window (or frame, or whatever the Slime terminology is), but the odd thing is that the behaviour changes (I think it will cycle buffers). Either way it can replace the contents of an existing window, which is particularly annoying when it replaces your code with a buffer telling you what’s wrong with the code and you then have to piss abount trying to get your code buffer back.
This code in ~/.emacs will allow you to use the pause key to protect windows by locking them to their current buffer. This will prevent e.g. slime compiler messages replacing those windows’ contents.
(defun toggle-current-window-dedication ()
(interactive)
(let* ((window (selected-window))
(dedicated (window-dedicated-p window)))
(set-window-dedicated-p window (not dedicated))
(message "Window %sdedicated to %s"
(if dedicated "no longer " "")
(buffer-name))))
(global-set-key [pause] 'toggle-current-window-dedication)
Lifted from Emacs: dedicated windows