annotate man/xemacs/entering.texi @ 359:8e84bee8ddd0 r21-1-9

Import from CVS: tag r21-1-9
author cvs
date Mon, 13 Aug 2007 10:57:55 +0200
parents 376386a54a3c
children 501cfd01ee6d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 @node Entering Emacs, Exiting, Pull-down Menus, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 @chapter Entering and Exiting Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @cindex entering Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @cindex entering XEmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 The usual way to invoke Emacs is to type @kbd{emacs @key{RET}} at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 shell (for XEmacs, type @kbd{xemacs @key{RET}}). Emacs clears the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 screen and then displays an initial advisory message and copyright
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 notice. You can begin typing Emacs commands immediately afterward.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 Some operating systems insist on discarding all type-ahead when Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 starts up; they give Emacs no way to prevent this. Therefore, it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 wise to wait until Emacs clears the screen before typing the first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 editing command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 @vindex initial-major-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 Before Emacs reads the first command, you have not had a chance to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 give a command to specify a file to edit. Since Emacs must always have a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 current buffer for editing, it presents a buffer, by default, a buffer named
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 @samp{*scratch*}. The buffer is in Lisp Interaction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 mode; you can use it to type Lisp expressions and evaluate them, or you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 can ignore that capability and simply doodle. You can specify a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 different major mode for this buffer by setting the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 @code{initial-major-mode} in your init file. @xref{Init File}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 It is possible to give Emacs arguments in the shell command line to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 specify files to visit, Lisp files to load, and functions to call.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 @node Exiting, Command Switches, Entering Emacs, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 @section Exiting Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 @cindex exiting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 @cindex killing Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 @cindex suspending
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 @cindex shrinking XEmacs frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 There are two commands for exiting Emacs because there are two kinds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 of exiting: @dfn{suspending} Emacs and @dfn{killing} Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 @dfn{Suspending} means stopping Emacs temporarily and returning control
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 to its superior (usually the shell), allowing you to resume editing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 later in the same Emacs job, with the same files, same kill ring, same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 undo history, and so on. This is the usual way to exit. @dfn{Killing}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 Emacs means destroying the Emacs job. You can run Emacs again later,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 but you will get a fresh Emacs; there is no way to resume the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 editing session after it has been killed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 @item C-z
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 Suspend Emacs (@code{suspend-emacs}). If used under the X window system,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 shrink the X window containing the Emacs frame to an icon (see below).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 @item C-x C-c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 Kill Emacs (@code{save-buffers-kill-emacs}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 If you use XEmacs under the X window system, @kbd{C-z} shrinks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 the X window containing the Emacs frame to an icon. The Emacs process
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 is stopped temporarily, and control is returned to the window manager.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 If more than one frame is associated with the Emacs process, only the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 frame from which you used @kbd{C-z} is retained. The X windows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 containing the other Emacs frames are closed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 To activate the "suspended" Emacs, use the appropriate window manager
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 mouse gestures. Usually left-clicking on the icon reactivates and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 reopens the X window containing the Emacs frame, but the window manager
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 you use determines what exactly happens. To actually kill the Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 process, use @kbd{C-x C-c} or the @b{Exit Emacs} item on the @b{File}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 @kindex C-z
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 @findex suspend-emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 On systems that do not permit programs to be suspended, @kbd{C-z} runs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 an inferior shell that communicates directly with the terminal, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 Emacs waits until you exit the subshell. On these systems, the only way
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 to return to the shell from which Emacs was started (to log out, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 example) is to kill Emacs. @kbd{C-d} or @code{exit} are typical
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 commands to exit a subshell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 @kindex C-x C-c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 @findex save-buffers-kill-emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 To kill Emacs, type @kbd{C-x C-c} (@code{save-buffers-kill-emacs}). A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 two-character key is used for this to make it harder to type. In
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 XEmacs, selecting the @b{Exit Emacs} option of the @b{File} menu is an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 alternate way of issuing the command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 Unless a numeric argument is used, this command first offers to save any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 modified buffers. If you do not save all buffers, you are asked for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 reconfirmation with @kbd{yes} before killing Emacs, since any changes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 not saved will be lost. If any subprocesses are still running, @kbd{C-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 C-c} asks you to confirm killing them, since killing Emacs kills the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 subprocesses simultaneously.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 In most programs running on Unix, certain characters may instantly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 suspend or kill the program. (In Berkeley Unix these characters are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 normally @kbd{C-z} and @kbd{C-c}.) @i{This Unix feature is turned off
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 while you are in Emacs.} The meanings of @kbd{C-z} and @kbd{C-x C-c} as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 keys in Emacs were inspired by the standard Berkeley Unix meanings of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 @kbd{C-z} and @kbd{C-c}, but that is their only relationship with Unix.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 You could customize these keys to do anything (@pxref{Keymaps}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 @c ??? What about system V here?