40 |
command-line argument to say which file to edit. |
command-line argument to say which file to edit. |
41 |
|
|
42 |
But starting a new Emacs each time you want to edit a different file |
But starting a new Emacs each time you want to edit a different file |
43 |
does not make sense. For one thing, this would be annoyingly slow. |
does not make sense. This would fail to take advantage of Emacs's |
44 |
For another, this would fail to take advantage of Emacs's ability to |
ability to visit more than one file in a single editing session, and |
45 |
visit more than one file in a single editing session. And it would |
it would lose the other accumulated context, such as the kill ring, |
46 |
lose the other accumulated context, such as the kill ring, registers, |
registers, undo history, and mark ring, that are useful for operating |
47 |
undo history, and mark ring. |
on multiple files. |
48 |
|
|
49 |
The recommended way to use GNU Emacs is to start it only once, just |
The recommended way to use GNU Emacs is to start it only once, just |
50 |
after you log in, and do all your editing in the same Emacs session. |
after you log in, and do all your editing in the same Emacs session. |
71 |
@cindex leaving Emacs |
@cindex leaving Emacs |
72 |
@cindex quitting Emacs |
@cindex quitting Emacs |
73 |
|
|
74 |
There are two commands for exiting Emacs because there are two kinds |
There are two commands for exiting Emacs because there are three |
75 |
of exiting: @dfn{suspending} Emacs and @dfn{killing} Emacs. |
kinds of exiting: @dfn{suspending} Emacs, @dfn{Iconifying} Emacs, and |
76 |
|
@dfn{killing} Emacs. |
77 |
|
|
78 |
@dfn{Suspending} means stopping Emacs temporarily and returning |
@dfn{Suspending} means stopping Emacs temporarily and returning |
79 |
control to its parent process (usually a shell), allowing you to resume |
control to its parent process (usually a shell), allowing you to resume |
80 |
editing later in the same Emacs job, with the same buffers, same kill |
editing later in the same Emacs job, with the same buffers, same kill |
81 |
ring, same undo history, and so on. This is the usual way to exit. |
ring, same undo history, and so on. This is the usual way to exit Emacs |
82 |
|
when running on a text terminal. |
83 |
|
|
84 |
|
@dfn{Iconifying} means replacing the Emacs frame with a small box |
85 |
|
somewhere on the screen. This is the usual way to exit Emacs when you're |
86 |
|
using a graphics terminal. |
87 |
|
|
88 |
@dfn{Killing} Emacs means destroying the Emacs job. You can run Emacs |
@dfn{Killing} Emacs means destroying the Emacs job. You can run Emacs |
89 |
again later, but you will get a fresh Emacs; there is no way to resume |
again later, but you will get a fresh Emacs; there is no way to resume |
99 |
|
|
100 |
@kindex C-z |
@kindex C-z |
101 |
@findex suspend-emacs |
@findex suspend-emacs |
102 |
To suspend Emacs, type @kbd{C-z} (@code{suspend-emacs}). This takes |
To suspend or iconify Emacs, type @kbd{C-z} (@code{suspend-emacs}). |
103 |
you back to the shell from which you invoked Emacs. You can resume |
On text terminals, this suspends Emacs. On graphics terminals, |
104 |
Emacs with the shell command @command{%emacs} in most common shells. |
it iconifies the Emacs frame. |
105 |
|
|
106 |
On systems that do not support suspending programs, @kbd{C-z} starts |
Suspending Emacs takes you back to the shell from which you invoked |
107 |
an inferior shell that communicates directly with the terminal. |
Emacs. You can resume Emacs with the shell command @command{%emacs} |
108 |
Emacs waits until you exit the subshell. (The way to do that is |
in most common shells. On systems that don't support suspending |
109 |
probably with @kbd{C-d} or @command{exit}, but it depends on which shell |
programs, @kbd{C-z} starts an inferior shell that communicates |
110 |
you use.) The only way on these systems to get back to the shell from |
directly with the terminal. Emacs waits until you exit the subshell. |
111 |
which Emacs was run (to log out, for example) is to kill Emacs. |
(The way to do that is probably with @kbd{C-d} or @command{exit}, but |
112 |
|
it depends on which shell you use.) The only way on these systems to |
113 |
Suspending also fails if you run Emacs under a shell that doesn't |
get back to the shell from which Emacs was run (to log out, for |
114 |
support suspending programs, even if the system itself does support it. |
example) is to kill Emacs. |
115 |
In such a case, you can set the variable @code{cannot-suspend} to a |
|
116 |
non-@code{nil} value to force @kbd{C-z} to start an inferior shell. |
Suspending can fail if you run Emacs under a shell that doesn't |
117 |
|
support suspending programs, even if the system itself does support |
118 |
|
it. In such a case, you can set the variable @code{cannot-suspend} to |
119 |
|
a non-@code{nil} value to force @kbd{C-z} to start an inferior shell. |
120 |
(One might also describe Emacs's parent shell as ``inferior'' for |
(One might also describe Emacs's parent shell as ``inferior'' for |
121 |
failing to support job control properly, but that is a matter of taste.) |
failing to support job control properly, but that is a matter of |
122 |
|
taste.) |
123 |
|
|
124 |
When Emacs communicates directly with an X server and creates its own |
On graphics terminals, @kbd{C-z} has a different meaning: it runs |
125 |
dedicated X windows, @kbd{C-z} has a different meaning. Suspending an |
the command @code{iconify-or-deiconify-frame}, which temporarily |
126 |
application that uses its own X windows is not meaningful or useful. |
iconifies (or ``minimizes'') the selected Emacs frame |
127 |
Instead, @kbd{C-z} runs the command @code{iconify-or-deiconify-frame}, |
(@pxref{Frames}). Then you can use the window manager to get back to |
128 |
which temporarily iconifies (or ``minimizes'') the selected Emacs |
a shell window. |
|
frame (@pxref{Frames}). Then you can use the window manager to get |
|
|
back to a shell window. |
|
129 |
|
|
130 |
@kindex C-x C-c |
@kindex C-x C-c |
131 |
@findex save-buffers-kill-emacs |
@findex save-buffers-kill-emacs |