18 File Handling
The operating system stores data permanently in named files, so most of the text you edit with Emacs comes from a file and is ultimately stored in a file.
To edit a file, you must tell Emacs to read the file and prepare a buffer containing a copy of the file’s text. This is called visiting the file. Editing commands apply directly to text in the buffer; that is, to the copy inside Emacs. Your changes appear in the file itself only when you save the buffer back into the file.
In addition to visiting and saving files, Emacs can delete, copy, rename, and append to files, keep multiple versions of them, and operate on file directories.
- File Names
- Visiting Files
- Saving Files
- Reverting a Buffer
- Auto Revert: Keeping buffers automatically up-to-date
- Auto-Saving: Protection Against Disasters
- File Name Aliases
- File Directories
- Comparing Files
- Diff Mode
- Copying, Naming and Renaming Files
- Miscellaneous File Operations
- Accessing Compressed Files
- File Archives
- Remote Files
- Quoted File Names
- File Name Cache
- Convenience Features for Finding Files
- Viewing Image Files
- Filesets