ErgoEmacsEmacsLispBlogEmacsLispBuy Tutorial

25.6 Frame Commands

The following commands let you create, delete and operate on frames:

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

The C-x 5 0 (delete-frame) command will never delete the last frame, to prevent you from losing the ability to interact with the Emacs process. 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.

On X, you may have to tell Emacs how the system (or the window manager) handles focus-switching between windows, in order for the command C-x 5 o (other-frame) to work properly. Unfortunately, there is no way for Emacs to detect this automatically, so you should set the variable focus-follows-mouse. If simply moving the mouse onto a window selects it and gives it focus, the variable should be t; if you have to click on the window to select it, the variable should be nil. The default is t.

The window manager that is part of MS-Windows always gives focus to a frame that raises, so this variable has no effect in the native MS-Windows build of Emacs.

blog comments powered by Disqus