Advanced Text-Fu · Lesson 13 of 13
Emacs Exiting and Help
0 / 5 checkpoints answered
Emacs provides contextual help for keys, functions, variables, and active modes. It also protects modified file-visiting buffers during exit, giving you a chance to save or decline each write.
Exiting Emacs
Use C-x C-c, which runs save-buffers-kill-terminal, to request that the Emacs session or terminal connection close:
C-x C-c
Emacs checks relevant modified file-visiting buffers and asks whether to save them. Read each buffer name and answer deliberately. It may also ask about active processes. Cancel the exit if you need to inspect work before deciding.
In an emacsclient workflow or an Emacs server, the exact frame and server behavior can differ, but modified-buffer prompts still deserve careful attention.
CheckWhich key sequence requests a normal Emacs exit and checks modified buffers?
press 1/2/3 to answer · → next lesson
Opening the Help Dispatcher
The standard help prefix is C-h. Use C-h C-h, which runs help for help, to display guidance on available help commands:
C-h C-h
The second key chooses the type of help you need.
CheckWhich key sequence explains how to use the Emacs help system?
press 1/2/3 to answer · → next lesson
Describing Keys and Editor State
Useful help commands include:
C-h k KEY: Describe what a key sequence runs.C-h f FUNCTION: Describe an Emacs Lisp function.C-h v VARIABLE: Describe an Emacs Lisp variable.C-h m: Describe the current major and minor modes.C-h t: Open the interactive tutorial.
For example, type C-h k C-x C-s to see documentation for the save-buffer binding.
CheckYou want to learn what C-x C-s does. Which help prefix should you enter before that key sequence?
press 1/2/3 to answer · → next lesson
Cancelling a Pending Command
Use C-g, bound to keyboard-quit, when you are stuck in a prompt, partially entered key sequence, incremental search, or other command you want to cancel:
C-g
It does not undo buffer changes that have already happened and does not exit Emacs. It stops the current interaction and returns control to ordinary editing when possible.
CheckWhich key normally cancels the current Emacs prompt or pending command?
press 1/2/3 to answer · → next lesson
Undoing Buffer Changes
Use C-/, C-_, or C-x u to invoke undo in common Emacs configurations:
C-/
Repeated undo commands walk backward through recent buffer changes. Cursor movement alone is not normally a buffer change. Emacs versions and configurations can offer undo-redo and more advanced history tools; use C-h k on your actual undo and redo bindings to verify local behavior.
CheckWhich key sequence is a standard binding for undoing a recent Emacs buffer change?
press 1/2/3 to answer · → next lesson
Practice by opening *scratch*, making a disposable change, using undo, asking C-h k about an unfamiliar key, and cancelling a minibuffer prompt with C-g before exiting normally.
Summary
You can now recover help and leave Emacs without ignoring unsaved work.
- Exit through the modified-buffer checks with
C-x C-c. - Open help for help with
C-h C-h. - Describe keys, functions, variables, or active modes.
- Cancel a pending command with
C-g. - Undo recent buffer changes with a verified local binding.
Lesson complete
You finished Emacs Exiting and Help. Nice work — keep the momentum going.