I want to close all my windows but the current one and maximize the frame so I can quickly see everything in the buffer in that one window, and then revert to my previous window setup. How would I go about doing this?
The different sections of text you see in your Emacs are windows. You can, for example, create a new window with
C-x 2. Yes, this terminology is confusing. It predates most GUI systems, so it's understandable if still confusing.
But once we know we're talking about windows, we can do the changes you want. To get rid of all windows except the one that point is in, run
C-x 1, mapped to
Then, for going back to what you had before, there's a pretty useful library called winner-mode. It lets you undo and redo changes to your window configuration.
So enable winner-mode with
M-x winner-mode, and then after you call
C-x 1, you can press
C-c left to undo the change to the window configuration, setting the windows back to what they were.
If you want to permanently enable winner-mode, put
(winner-mode) in your init file.
winner-mode is handy, but if you really just want to flip back and forth between one window and a multi-window configuration, here's something I've used before:
(defvar window-split-saved-config nil) (defun window-split-toggle-one-window () "Make the current window fill the frame. If there is only one window try reverting to the most recently saved window configuration." (interactive) (if (and window-split-saved-config (not (window-parent))) (set-window-configuration window-split-saved-config) (setq window-split-saved-config (current-window-configuration)) (delete-other-windows)))
You could bind that to e.g.
C-x 1 and use that same key to toggle the states.
I use the following, copied from the web. It's a quick way to leave your current window configuration. After you are done use
exit-recursive-edit to get back.
;; http://www.emacswiki.org/emacs/RecursiveEditPreservingWindowConfig ;; inspired by Erik Naggum's `recursive-edit-with-single-window' (defmacro recursive-edit-preserving-window-config (body) "*Return a command that enters a recursive edit after executing BODY. Upon exiting the recursive edit (with\\[exit-recursive-edit] (exit) or \\[abort-recursive-edit] (abort)), restore window configuration in current frame." `(lambda () "See the documentation for `recursive-edit-preserving-window-config'." (interactive) (save-window-excursion ,body (recursive-edit)))) (global-set-key (kbd "C-c 0") (recursive-edit-preserving-window-config (delete-window))) (global-set-key (kbd "C-c 1") (recursive-edit-preserving-window-config (if (one-window-p 'ignore-minibuffer) (error "Current window is the only window in its frame") (delete-other-windows))))