15.3 Files, buffers and windows

A buffer contains work; a window displays it. Identify the selected buffer with C-e m before editing, saving or closing anything. For definitions, see Buffers, windows and frames.

Open a file (C-x C-f)

Visit a pathname, creating a new unsaved buffer if the file does not exist. C-x C-r visits read-only instead. See Checking the document and its destination.

Save the current file (C-x C-s)

Write this buffer to its file; a new buffer may need a filename. An error is not a completed save. See Saving destinations and failure recovery.

Save under another filename (C-x C-w)

Write the current text, including unsaved edits, and change where this buffer’s later saves go. Cancel an unexpected overwrite prompt. See Working copies versus copies of saved files.

Switch to another buffer (C-x b)

Select content by buffer name in the current window. The buffer you leave stays available. See Buffer selection.

Display a reference (C-x 4 b)

Display and select an existing buffer in another window, creating or reusing a view. See Keeping a reference beside a draft.

Select another window (C-x o)

Select the next view; lowercase o is not zero. With more than two windows, the next one need not be the draft. See Identifying the selected view.

Remove a window (C-x 0)

Remove this view, not its buffer. The last ordinary window cannot be removed this way. C-x 1 instead keeps only the selected view. See Closing windows without losing documents.

Close a buffer (C-x k)

Kill the named buffer, checking any unsaved-work prompt. This is not the same as removing its window or deleting its file. See Leaving document buffers safely.