Next: Command Switches Prev: Entering Emacs Up: Top
There are two commands for exiting Emacs because there are two kinds
of exiting: "suspending" Emacs and "killing" Emacs. "Suspending" means
stopping Emacs temporarily and returning control to its superior
(usually the shell), allowing you to resume editing later in the same
Emacs job, with the same files, same kill ring, same undo history, and
so on. This is the usual way to exit. "Killing" Emacs means
destroying the Emacs job. You can run Emacs again later, but you will
get a fresh Emacs; there is no way to resume the same editing session
after it has been killed.
Suspend Emacs (`suspend-emacs'). If used under the X window
system, shrink the X window containing the Emacs screen to an icon
Kill Emacs (`save-buffers-kill-emacs').
If you use Lucid Emacs under the X window system, `C-z' shrinks the
X window containing the Emacs screen to an icon. The Emacs process is
stopped temporarily, and control is returned to the window manager. If
more than one screen is associated with the Emacs process, only the
screen from which you used `C-z' is retained. The X windows containing
the other Emacs screens are closed.
To activate the "suspended" Emacs, use the appropriate window manager
mouse gestures. Usually left-clicking on the icon reactivates and
reopens the X window containing the Emacs screen, but the window manager
you use determines what exactly happens. To actually kill the Emacs
process, use `C-x C-c' or the Exit Emacs item on the File menu.
On systems that do not permit programs to be suspended, `C-z' runs
an inferior shell that communicates directly with the terminal, and
Emacs waits until you exit the subshell. On these systems, the only way
to return to the shell from which Emacs was started (to log out, for
example) is to kill Emacs. `C-d' or `exit' are typical commands to
exit a subshell.
To kill Emacs, type `C-x C-c' (`save-buffers-kill-emacs'). A
two-character key is used for this to make it harder to type. In Lucid
Emacs, selecting the Exit Emacs option of the File menu is an alternate
way of issuing the command.
Unless a numeric argument is used, this command first offers to save
any modified buffers. If you do not save all buffers, you are asked for
reconfirmation with `yes' before killing Emacs, since any changes not
saved will be lost. If any subprocesses are still running, `C-x C-c'
asks you to confirm killing them, since killing Emacs kills the
In most programs running on Unix, certain characters may instantly
suspend or kill the program. (In Berkeley Unix these characters are
normally `C-z' and `C-c'.) This Unix feature is turned off while you
are in Emacs. The meanings of `C-z' and `C-x C-c' as keys in Emacs were
inspired by the standard Berkeley Unix meanings of `C-z' and `C-c', but
that is their only relationship with Unix. You could customize these
keys to do anything (Note: Keymaps.).
automatically generated by info2www