Basically that. I need a function that would do this when I open a buffer in a frame with many other windows. Maybe Emacs has one by default.
C-x 5 2 does what you request: it opens the current buffer in a separate frame. But it does not delete the original window showing the buffer in the original frame.
tear-off-window does both: opens the buffer in a separate frame and deletes its window from the original frame.
Personally, I bind
C-x 5 1. (I don't use that key's original binding of