![[Home]](https://www.emacswiki.org/images/logo218x38.png)
This is a subpage of CategoryFrames and CategoryModes. It describes frame setups, frame commands, and frame functions.
These libraries provide functions that resize frames so they fit their buffer(s):
Use these libraries especially if you use frames, instead of Emacs windows, by default – that is, if you have (setq pop-up-frames t).
See Shrink-Wrapping Frames for more information.
Library oneonone.el makes Emacs more frame-oriented. See OneOnOneEmacs for more information. Here is a summary:
‘special-display-frame-alist’).*Help* buffer frame*Completions* buffer frame‘1on1-minibuffer-frame’ – a standalone minibuffer frameThis library is especially useful if used in combination with libraries autofit-frame.el, which automatically fits frames to their selected window (buffer), and fit-frame.el, which lets you fit a frame manually or resize it incrementally. See ShrinkWrappedFrames.
Note: Because Emacs is not really designed to be frame-oriented, there are some built-in and standard functions that produce less-than-desirable results when frames, instead of windows, are the default. In other libraries, I have fixed most of these functions to play well with this library. See the libraries by DrewAdams that are named <file>-.el and <file>+.el, where <file> is the name of a standard Emacs library.
The properties of all frames are user-configurable using variables.
This section describes commands (interactive functions) dealing with frames.
Library frame-cmds.el is a library of frame commands. Using the suggested key bindings, you can:
‘C-x 5 2’ to clone the selected frame, that is, create a new frame with the same charactistics (frame parameters).‘C-M-’ with the arrow keys (up, down, left, right) to resize a frame incrementally.‘M-’ with the arrow keys to move a frame incrementally.‘C-S-v’ (bottom), ‘M-S-v’ (top), ‘C-S-next’ (right), ‘C-S-prior’ (left).‘M-x tile-frames-horizontally’ and ‘M-x tile-frames-vertically’ to tile all visible frames.‘M-x maximize-frame-horizontally’, ‘M-x maximize-frame-vertically’, and ‘M-x max-frame’ to maximize the current frame.‘C-M-z’ or ‘C-x C-z’ to iconify/hide all frames – see ‘show-hide’, below.‘C-M-z’ in a lone frame to restore all frames – see ‘show-hide’, below.‘C-mouse-1’ in the minibuffer to restore all frames – see ‘mouse-show-hide-mark-unmark’, below.‘C-mouse-1’ in Dired to mark/unmark a file – see ‘mouse-show-hide-mark-unmark’, below.‘C-mouse-3’ on the mode line to remove window from frame – see ‘mouse-remove-window’, below.These are some of the commands in frame-cmds.el:
‘clone-frame’ – Copy selected frame to a new frame with the same parameters.‘enlarge-frame’, ‘enlarge-frame-horizontally’, ‘shrink-frame’, and ‘shrink-frame-horizontally’ – Resize a frame incrementally.‘tile-frames-horizontally’ and ‘tile-frames-vertically’ – Tile the visible frames horizontally and vertically.‘move-frame-up’, ‘move-frame-down’, ‘move-frame-left’, and ‘move-frame-right’ – Move a frame incrementally.‘move-frame-to-screen-top’, ‘move-frame-to-screen-bottom’, ‘move-frame-to-screen-left’, ‘move-frame-to-screen-right’ – Move a frame to a screen edge.‘enlarge-font’ – Incrementally change the size of a frame’s font. See also these frame-zooming commands in library zoom-frm.el: ‘zoom-frm-in’, ‘zoom-frm-out’, ‘zoom-frm-unzoom’, ‘toggle-zoom-frame’.‘set-frame-alist-parameter-from-frame’ and ‘set-all-frame-alist-parameters-from-frame’ – Update a frame-parameter alist, such as ‘default-frame-alist’, using the parameters of the current frame.‘tell-customize-var-has-changed’ – Tell customize to consider that a given variable has been set (changed).‘show-hide’ – If only one frame is visible then call ‘show-hide-show-function’; else call ‘hide-everything’ (see below). By default, ‘show-hide-show-function’ is ‘jump-to-frame-config-register’, which restores the frame configuration saved when you ‘iconify-everything’ or ‘hide-everything’.‘iconify-everything’ – Iconify all frames of session at once. Save frame configuration for restoring by ‘show-hide’.‘hide-everything’ – Hide all frames of session at once. Iconify standalone minibuffer frame (if any); make all other frames invisible. Save frame configuration for restoring by ‘show-hide’.‘show-buffer-menu’ – Call ‘buffer-menu’ after making all frames visible.‘mouse-show-hide-mark-unmark’ – Mouse command (bind to mouse click) that acts differently, depending on where mouse is clicked:‘show-hide’ if in minibuffer.‘buffer-menu’ if clicked elsewhere.‘iconify/map-frame’ – Iconify selected frame if now mapped. Map it if now iconified. With non-nil prefix arg, iconify all visible frames.‘mouse-iconify/map-frame’ – Iconify frame clicked on, if now mapped. Map it if now iconified.‘remove-window’ – Remove window from the display (default is ‘selected-window’). If window is the only one in its frame, then:‘remove-windows-on’ – Remove all windows showing buffer (calls ‘remove-window’ on each window showing buffer).‘mouse-remove-window’ – Remove the window you click on (calls ‘remove-window’).‘delete/iconify-window’ – Delete or iconify window (default: ‘selected-window’).‘delete/iconify-windows-on’ – For each window showing buffer: delete it or iconify its frame. (This calls ‘delete/iconify-window’ on each window showing buffer.) Interactively, treats all windows showing buffer in any frame. Prefix argument functions the same as in command ‘delete/iconify-window’.‘rename-frame’ – Rename a frame. Prefix arg non-nil means rename all frames that have the same name. Default frame to rename is ‘selected-frame’. Default new name is ‘buffer-name’.‘show-frame’ – Make frame visible and raise it, without selecting it.‘hide-frame’ – Make frame invisible. Like ‘make-frame-invisible’, but reads frame name.‘show-a-frame-on’ – Make visible and raise a frame showing buffer, if there is one. Neither the frame nor the buffer is selected.‘show-*Help*-buffer’ – Raise a frame showing buffer ‘*Help*’, without selecting it.‘delete-1-window-frames-on’ – Delete all visible 1-window frames showing buffer.For commands to resize a frame to fit its selected window, see libraries fit-frame.el and autofit-frame.el (and more info at Shrink-Wrapping Frames). In Windows, library fit-frame.el also has commands to maximize and restore a frame.