Next: , Previous: Creating Frames, Up: Frames

21.7 Frame Commands

The following commands are used to delete and operate on frames:

C-x 5 0
Delete the selected frame (delete-frame). This signals an error if there is only one frame.
C-z
Minimize (or “iconify) the selected Emacs frame (suspend-frame). See Exiting.
C-x 5 o
Select another frame, and raise it. If you repeat this command, it cycles through all the frames on your terminal.
C-x 5 1
Delete all frames on the current terminal, except the selected one.

The C-x 5 0 (delete-frame) command deletes the selected frame. However, it will refuse to delete the last frame in an Emacs session, to prevent you from losing the ability to interact with the Emacs session. Note that when Emacs is run as a daemon (see Emacs Server), there is always a “virtual frame” that remains after all the ordinary, interactive frames are deleted. In this case, C-x 5 0 can delete the last interactive frame; you can use emacsclient to reconnect to the Emacs session.

The C-x 5 1 (delete-other-frames) command deletes all other frames on the current terminal (this terminal refers to either a graphical display, or a text terminal; see Non-Window Terminals). If the Emacs session has frames open on other graphical displays or text terminals, those are not deleted.

The C-x 5 o (other-frame) command selects the next frame on the current terminal. If you are using Emacs on the X Window System with a window manager that selects (or gives focus to) whatever frame the mouse cursor is over, you have to change the variable focus-follows-mouse to t in order for this command to work properly. Then invoking C-x 5 o will also warp the mouse cursor to the chosen frame.