annotate man/xemacs/entering.texi @ 5922:4b055de36bb9 cygwin

merging heads 2
author Henry Thompson <ht@markup.co.uk>
date Fri, 27 Feb 2015 17:47:15 +0000
parents 7844ab77b582
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
1 @c This is part of the XEmacs manual.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
2 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995 Free Software Foundation, Inc.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
3 @c See file xemacs.texi for copying conditions.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @node Entering Emacs, Exiting, Pull-down Menus, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @chapter Entering and Exiting Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @cindex entering XEmacs
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
7 @cindex starting XEmacs
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
8
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
9 The usual way to invoke XEmacs is to type @kbd{xemacs @key{RET}} at
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
10 the shell. XEmacs clears the screen and then displays an initial
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
11 advisory message and copyright notice. You can begin typing XEmacs
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
12 commands immediately afterward.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
14 Some operating systems insist on discarding all type-ahead when XEmacs
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
15 starts up; they give XEmacs no way to prevent this. Therefore, it is
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
16 advisable to wait until XEmacs clears the screen before typing your first
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
17 editing command.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
19 If you run XEmacs from a shell window under the X Window System, run it
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
20 in the background with @samp{xemacs&}. This way, XEmacs does not tie up
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
21 the shell window, so you can use that to run other shell commands while
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
22 XEmacs operates its own X windows. You can begin typing XEmacs commands
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
23 as soon as you direct your keyboard input to the XEmacs frame.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 @vindex initial-major-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 Before Emacs reads the first command, you have not had a chance to
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
27 give a command to specify a file to edit. Since Emacs must always have
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
28 a current buffer for editing, it presents a buffer, by default, a buffer
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
29 named @samp{*scratch*}. The buffer is in Lisp Interaction mode; you can
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
30 use it to type Lisp expressions and evaluate them, or you can ignore
2757
7844ab77b582 [xemacs-hg @ 2005-05-05 17:10:19 by aidan]
aidan
parents: 408
diff changeset
31 that capability and simply doodle. (Which is where the name comes from;
7844ab77b582 [xemacs-hg @ 2005-05-05 17:10:19 by aidan]
aidan
parents: 408
diff changeset
32 a ``scratch pad'' is a set of paper for doodling on, something not
7844ab77b582 [xemacs-hg @ 2005-05-05 17:10:19 by aidan]
aidan
parents: 408
diff changeset
33 necessarily clear to all the English-speakers who read this.)
7844ab77b582 [xemacs-hg @ 2005-05-05 17:10:19 by aidan]
aidan
parents: 408
diff changeset
34
7844ab77b582 [xemacs-hg @ 2005-05-05 17:10:19 by aidan]
aidan
parents: 408
diff changeset
35 You can specify a different major mode for this buffer by setting the
7844ab77b582 [xemacs-hg @ 2005-05-05 17:10:19 by aidan]
aidan
parents: 408
diff changeset
36 variable @code{initial-major-mode} in your init file. @xref{Init File}.
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
37
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
38 It is possible to specify files to be visited, Lisp files to be
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
39 loaded, and functions to be called, by giving Emacs arguments in the
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
40 shell command line. @xref{Command Switches}. But we don't recommend
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
41 doing this. The feature exists mainly for compatibility with other
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
42 editors.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
44 Many other editors are designed to be started afresh each time you
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
45 want to edit. You edit one file and then exit the editor. The next
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
46 time you want to edit either another file or the same one, you must run
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
47 the editor again. With these editors, it makes sense to use a
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
48 command-line argument to say which file to edit.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
49
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
50 But starting a new Emacs each time you want to edit a different file
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
51 does not make sense. For one thing, this would be annoyingly slow. For
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
52 another, this would fail to take advantage of Emacs's ability to visit
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
53 more than one file in a single editing session. And it would lose the
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
54 other accumulated context, such as registers, undo history, and the mark
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
55 ring.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
56
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
57 The recommended way to use XEmacs is to start it only once, just
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
58 after you log in, and do all your editing in the same Emacs session.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
59 Each time you want to edit a different file, you visit it with the
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
60 existing Emacs, which eventually comes to have many files in it ready
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
61 for editing. Usually you do not kill the Emacs until you are about to
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
62 log out. @xref{Files}, for more information on visiting more than one
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
63 file.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 @node Exiting, Command Switches, Entering Emacs, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 @section Exiting Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 @cindex exiting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 @cindex killing Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 @cindex suspending
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
70 @cindex leaving Emacs
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
71 @cindex quitting Emacs
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 @cindex shrinking XEmacs frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 There are two commands for exiting Emacs because there are two kinds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 of exiting: @dfn{suspending} Emacs and @dfn{killing} Emacs.
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
76
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
77 @dfn{Suspending} means stopping Emacs temporarily and returning
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
78 control to its parent process (usually a shell), allowing you to resume
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
79 editing later in the same Emacs job, with the same buffers, same kill
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
80 ring, same undo history, and so on. This is the usual way to exit.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
81
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
82 @dfn{Killing} Emacs means destroying the Emacs job. You can run Emacs
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
83 again later, but you will get a fresh Emacs; there is no way to resume
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
84 the same editing session after it has been killed.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 @item C-z
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
88 Suspend Emacs or iconify a frame
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
89 (@code{suspend-emacs-or-iconify-frame}). If used under the X window
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
90 system, shrink the X window containing the Emacs frame to an icon (see
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
91 below).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 @item C-x C-c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 Kill Emacs (@code{save-buffers-kill-emacs}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 If you use XEmacs under the X window system, @kbd{C-z} shrinks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 the X window containing the Emacs frame to an icon. The Emacs process
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 is stopped temporarily, and control is returned to the window manager.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 If more than one frame is associated with the Emacs process, only the
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
100 frame from which you used @kbd{C-z} is iconified.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 To activate the "suspended" Emacs, use the appropriate window manager
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 mouse gestures. Usually left-clicking on the icon reactivates and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 reopens the X window containing the Emacs frame, but the window manager
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 you use determines what exactly happens. To actually kill the Emacs
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
106 process, use @kbd{C-x C-c} or the @b{Exit XEmacs} item on the @b{File}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 @kindex C-z
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 @findex suspend-emacs
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
111 To suspend Emacs, type @kbd{C-z} (@code{suspend-emacs}). This takes
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
112 you back to the shell from which you invoked Emacs. You can resume
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
113 Emacs with the shell command @samp{%xemacs} in most common shells.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
114
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
115 On systems that do not support suspending programs, @kbd{C-z} starts
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
116 an inferior shell that communicates directly with the terminal.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
117 Emacs waits until you exit the subshell. (The way to do that is
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
118 probably with @kbd{C-d} or @samp{exit}, but it depends on which shell
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
119 you use.) The only way on these systems to get back to the shell from
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
120 which Emacs was run (to log out, for example) is to kill Emacs.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
121
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
122 Suspending also fails if you run Emacs under a shell that doesn't
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
123 support suspending programs, even if the system itself does support it.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
124 In such a case, you can set the variable @code{cannot-suspend} to a
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
125 non-@code{nil} value to force @kbd{C-z} to start an inferior shell.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
126 (One might also describe Emacs's parent shell as ``inferior'' for
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
127 failing to support job control properly, but that is a matter of taste.)
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
128
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
129 When Emacs communicates directly with an X server and creates its own
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
130 dedicated X windows, @kbd{C-z} has a different meaning. Suspending an
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
131 applications that uses its own X windows is not meaningful or useful.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
132 Instead, @kbd{C-z} runs the command @code{iconify-or-deiconify-frame},
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
133 which temporarily closes up the selected Emacs frame.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
134 The way to get back to a shell window is with the window manager.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 @kindex C-x C-c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 @findex save-buffers-kill-emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 To kill Emacs, type @kbd{C-x C-c} (@code{save-buffers-kill-emacs}). A
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
139 two-character key is used for this to make it harder to type. Selecting
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
140 the @b{Exit XEmacs} option of the @b{File} menu is an alternate way of
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
141 issuing the command.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 Unless a numeric argument is used, this command first offers to save any
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
144 modified file-visiting buffers. If you do not save all buffers, you are
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
145 asked for reconfirmation with @kbd{yes} before killing Emacs, since any
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
146 changes not saved will be lost forever. If any subprocesses are still
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
147 running, @kbd{C-x C-c} asks you to confirm killing them, since killing
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
148 Emacs will kill the subprocesses immediately.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
150 There is no way to restart an Emacs session once you have killed it.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
151 You can, however, arrange for Emacs to record certain session
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
152 information, such as which files are visited, when you kill it, so that
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
153 the next time you restart Emacs it will try to visit the same files and
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
154 so on.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
155 @c @xref{Saving Emacs Sessions}.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
157 The operating system usually listens for certain special characters
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
158 whose meaning is to kill or suspend the program you are running.
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
159 @b{This operating system feature is turned off while you are in Emacs.}
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
160 The meanings of @kbd{C-z} and @kbd{C-x C-c} as keys in Emacs were
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
161 inspired by the use of @kbd{C-z} and @kbd{C-c} on several operating
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
162 systems as the characters for stopping or killing a program, but that is
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
163 their only relationship with the operating system. You can customize
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 0
diff changeset
164 these keys to run any commands of your choice (@pxref{Keymaps}).