Often, I my windows get automatically split until I arbitrarily decide that the current frame does not have enough real-estate for them all. When this occurs, I manually delete a window, create a frame, and switch to that deleted window. How can I write an elisp function that does this?
I tried:
(defun pop-window-into-frame ()
(interactive)
(delete-window)
(make-frame-command)
(switch-to-prev-buffer))
But for some reason this doesn't do what I think it should.