aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-12-08 21:21:58 +0800
committerChong Yidong2011-12-08 21:21:58 +0800
commitb09d01daefabb424b0a02b2ae364f29064ddfd9d (patch)
tree9bddd1ab033c935ca282ea6ef751c82305be51cf
parent39c9faef2f2027336f7235d5521269714cc370c8 (diff)
downloademacs-b09d01daefabb424b0a02b2ae364f29064ddfd9d.tar.gz
emacs-b09d01daefabb424b0a02b2ae364f29064ddfd9d.zip
Updates to Building chapter of Emacs manual.
* doc/emacs/building.texi (Compilation): Say what the -k flag to make does. Move subprocess discussion to Compilation Shell. (Compilation Mode): Add xref for grep, occur, and mouse references. Define "locus". (Grep Searching): Use @command. * doc/emacs/programs.texi (Symbol Completion): M-TAB can now use Semantic. (Semantic): Add cindex entries for Semantic.
-rw-r--r--doc/emacs/ChangeLog11
-rw-r--r--doc/emacs/building.texi420
-rw-r--r--doc/emacs/emacs.texi2
-rw-r--r--doc/emacs/programs.texi16
4 files changed, 225 insertions, 224 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 20a6e8e84d7..2627586f1f4 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,14 @@
12011-12-08 Chong Yidong <cyd@gnu.org>
2
3 * building.texi (Compilation): Say what the -k flag to make does.
4 Move subprocess discussion to Compilation Shell.
5 (Compilation Mode): Add xref for grep, occur, and mouse
6 references. Define "locus".
7 (Grep Searching): Use @command.
8
9 * programs.texi (Symbol Completion): M-TAB can now use Semantic.
10 (Semantic): Add cindex entries for Semantic.
11
12011-12-06 Chong Yidong <cyd@gnu.org> 122011-12-06 Chong Yidong <cyd@gnu.org>
2 13
3 * programs.texi (Man Page): Clarify how to use Man-switches. 14 * programs.texi (Man Page): Clarify how to use Man-switches.
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 9c5b2e7dcd7..34ac5887a1d 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -8,9 +8,9 @@
8@cindex program building 8@cindex program building
9@cindex running Lisp functions 9@cindex running Lisp functions
10 10
11 The previous chapter discusses the Emacs commands that are useful for 11 The previous chapter discusses the Emacs commands that are useful
12making changes in programs. This chapter deals with commands that assist 12for making changes in programs. This chapter deals with commands that
13in the larger process of compiling and testing programs. 13assist in the process of compiling and testing programs.
14 14
15@menu 15@menu
16* Compilation:: Compiling programs in languages other 16* Compilation:: Compiling programs in languages other
@@ -37,10 +37,10 @@ in the larger process of compiling and testing programs.
37@cindex compilation errors 37@cindex compilation errors
38@cindex error log 38@cindex error log
39 39
40 Emacs can run compilers for noninteractive languages such as C and 40 Emacs can run compilers for languages such as C and Fortran as
41Fortran as inferior processes, feeding the error log into an Emacs buffer. 41inferior processes, feeding the compilation log into an Emacs buffer.
42It can also parse the error messages and show you the source lines where 42It can also parse the error messages and show you where the errors
43compilation errors occurred. 43occurred.
44 44
45@table @kbd 45@table @kbd
46@item M-x compile 46@item M-x compile
@@ -54,65 +54,60 @@ Kill the running compilation subprocess.
54@end table 54@end table
55 55
56@findex compile 56@findex compile
57 To run @code{make} or another compilation command, do @kbd{M-x 57 To run @code{make} or another compilation command, type @kbd{M-x
58compile}. This command reads a shell command line using the minibuffer, 58compile}. This reads a shell command line using the minibuffer, and
59and then executes the command in an inferior shell, putting output in 59then executes the command in an inferior shell, putting output in the
60the buffer named @samp{*compilation*}. The current buffer's default 60buffer named @samp{*compilation*}. The current buffer's default
61directory is used as the working directory for the execution of the 61directory is used as the working directory for the execution of the
62command; normally, therefore, the compilation happens in this 62command; normally, therefore, compilation takes place in this
63directory. 63directory.
64 64
65@vindex compile-command 65@vindex compile-command
66 The default for the compilation command is normally @samp{make -k}, 66 The default compilation command is @samp{make -k}, which is usually
67which is correct most of the time for nontrivial programs. 67correct for programs compiled using the @command{make} utility (the
68@xref{Top,, Make, make, GNU Make Manual}. If you have done @kbd{M-x 68@samp{-k} flag tells @command{make} to continue compiling as much as
69compile} before, the default each time is the command you used the 69possible after an error). @xref{Top,, Make, make, GNU Make Manual}.
70previous time. @code{compile} stores this command in the variable 70If you have done @kbd{M-x compile} before, the command that you
71@code{compile-command}, so setting that variable specifies the default 71specified is automatically stored in the variable
72for the next use of @kbd{M-x compile}. If a file specifies a file 72@code{compile-command}; this is used as the default the next time you
73local value for @code{compile-command}, that provides the default when 73type @kbd{M-x compile}. A file can also specify a file-local value
74you type @kbd{M-x compile} in that file's buffer. @xref{File 74for @code{compile-command} (@pxref{File Variables}).
75Variables}. 75
76 76 Starting a compilation displays the @samp{*compilation*} buffer in
77 Starting a compilation displays the buffer @samp{*compilation*} in 77another window but does not select it. While the compilation is
78another window but does not select it. The buffer's mode line tells 78running, the word @samp{run} is shown in the major mode indicator for
79you whether compilation is finished, with the word @samp{run}, 79the @samp{*compilation*} buffer, and the word @samp{Compiling} appears
80@samp{signal} or @samp{exit} inside the parentheses. You do not have 80in all mode lines. You do not have to keep the @samp{*compilation*}
81to keep this buffer visible; compilation continues in any case. While 81buffer visible while compilation is running; it continues in any case.
82a compilation is going on, the string @samp{Compiling} appears in the 82When the compilation ends, for whatever reason, the mode line of the
83mode lines of all windows. When this string disappears, the 83@samp{*compilation*} buffer changes to say @samp{exit} (followed by
84compilation is finished. 84the exit code: @samp{[0]} for a normal exit), or @samp{signal} (if a
85 85signal terminated the process).
86 If you want to watch the compilation transcript as it appears, switch 86
87to the @samp{*compilation*} buffer and move point to the end of the 87 If you want to watch the compilation transcript as it appears,
88buffer. When point is at the end, new compilation output is inserted 88switch to the @samp{*compilation*} buffer and move point to the end of
89above point, which remains at the end. If point is not at the end of 89the buffer. When point is at the end, new compilation output is
90the buffer, it remains fixed while more compilation output is added at 90inserted above point, which remains at the end. Otherwise, point
91the end of the buffer. 91remains fixed while compilation output is added at the end of the
92buffer.
92 93
93@cindex compilation buffer, keeping point at end 94@cindex compilation buffer, keeping point at end
94@vindex compilation-scroll-output 95@vindex compilation-scroll-output
95 If you change the variable @code{compilation-scroll-output} to a 96 If you change the variable @code{compilation-scroll-output} to a
96non-@code{nil} value, the compilation buffer will scroll automatically 97non-@code{nil} value, the @samp{*compilation*} buffer scrolls
97to follow the output as it comes in. If the value is 98automatically to follow the output. If the value is
98@code{first-error}, the scrolling stops at the first error that 99@code{first-error}, scrolling stops when the first error appears,
99appears, leaving point at that error. For any other non-@code{nil} 100leaving point at that error. For any other non-@code{nil} value,
100value, the buffer continues scrolling until there is no more output. 101scrolling continues until there is no more output.
101 102
102@findex recompile 103@findex recompile
103 To rerun the last compilation with the same command, type @kbd{M-x 104 To rerun the last compilation with the same command, type @kbd{M-x
104recompile}. This automatically reuses the compilation command from 105recompile}. This reuses the compilation command from the last
105the last invocation of @kbd{M-x compile}. It also reuses the 106invocation of @kbd{M-x compile}. It also reuses the
106@samp{*compilation*} buffer and starts the compilation in its default 107@samp{*compilation*} buffer and starts the compilation in its default
107directory, which is the directory in which the previous compilation 108directory, which is the directory in which the previous compilation
108was started. 109was started.
109 110
110 When the compiler process terminates, for whatever reason, the mode
111line of the @samp{*compilation*} buffer changes to say @samp{exit}
112(followed by the exit code, @samp{[0]} for a normal exit), or
113@samp{signal} (if a signal terminated the process), instead of
114@samp{run}.
115
116@findex kill-compilation 111@findex kill-compilation
117 Starting a new compilation also kills any compilation already 112 Starting a new compilation also kills any compilation already
118running in @samp{*compilation*}, as the buffer can only handle one 113running in @samp{*compilation*}, as the buffer can only handle one
@@ -126,27 +121,6 @@ the @samp{*compilation*} buffer (perhaps using @code{rename-uniquely};
126@pxref{Misc Buffer}), then switch buffers and start the other 121@pxref{Misc Buffer}), then switch buffers and start the other
127compilation. This will create a new @samp{*compilation*} buffer. 122compilation. This will create a new @samp{*compilation*} buffer.
128 123
129 Emacs does not expect a compiler process to launch asynchronous
130subprocesses; if it does, and they keep running after the main
131compiler process has terminated, Emacs may kill them or their output
132may not arrive in Emacs. To avoid this problem, make the main process
133wait for its subprocesses to finish. In a shell script, you can do this
134using @samp{$!} and @samp{wait}, like this:
135
136@example
137(sleep 10; echo 2nd)& pid=$! # @r{Record pid of subprocess}
138echo first message
139wait $pid # @r{Wait for subprocess}
140@end example
141
142 If the background process does not output to the compilation buffer,
143so you only need to prevent it from being killed when the main
144compilation process terminates, this is sufficient:
145
146@example
147nohup @var{command}; sleep 1
148@end example
149
150@vindex compilation-environment 124@vindex compilation-environment
151 You can control the environment passed to the compilation command 125 You can control the environment passed to the compilation command
152with the variable @code{compilation-environment}. Its value is a list 126with the variable @code{compilation-environment}. Its value is a list
@@ -159,153 +133,154 @@ variable settings override the usual ones.
159 133
160@cindex Compilation mode 134@cindex Compilation mode
161@cindex mode, Compilation 135@cindex mode, Compilation
162 The @samp{*compilation*} buffer uses a special major mode, 136@cindex locus
163Compilation mode, whose main feature is to provide a convenient way to 137 The @samp{*compilation*} buffer uses a major mode called Compilation
164visit the source line corresponding to an error message. These 138mode. Compilation mode turns each error message in the buffer into a
165commands are also available in other special buffers that list 139hyperlink; you can move point to it and type @key{RET}, or click on it
166locations in files, including those made by @kbd{M-x grep} and 140with the mouse (@pxref{Mouse References}), to visit the @dfn{locus} of
167@kbd{M-x occur}. 141the error message in a separate window. The locus is the specific
142position in a file where that error occurred.
143
144@findex compile-goto-error
145@vindex compilation-auto-jump-to-first-error
146 If you change the variable
147@code{compilation-auto-jump-to-first-error} to a non-@code{nil} value,
148Emacs automatically visits the locus of the first error message that
149appears in the @samp{*compilation*} buffer.
150
151 Compilation mode provides the following additional commands. These
152commands can also be used in @samp{*grep*} buffers, where the
153hyperlinks are search matches rather than error messages (@pxref{Grep
154Searching}).
168 155
169@table @kbd 156@table @kbd
170@item M-g M-n 157@item M-g M-n
171@itemx M-g n 158@itemx M-g n
172@itemx C-x ` 159@itemx C-x `
173Visit the locus of the next error message or match. 160Visit the locus of the next error message or match (@code{next-error}).
174@item M-g M-p 161@item M-g M-p
175@itemx M-g p 162@itemx M-g p
176Visit the locus of the previous error message or match. 163Visit the locus of the previous error message or match
177@item @key{RET} 164(@code{previous-error}).
178Visit the locus of the error message that point is on.
179This command is used in the compilation buffer.
180@item Mouse-2
181Visit the locus of the error message that you click on.
182@item M-n 165@item M-n
183Find and highlight the locus of the next error message, without 166Move point to the next error message or match, without visiting its
184selecting the source buffer. 167locus (@code{compilation-next-error}).
185@item M-p 168@item M-p
186Find and highlight the locus of the previous error message, without 169Move point to the previous error message or match, without visiting
187selecting the source buffer. 170its locus (@code{compilation-previous-error}).
188@item M-@} 171@item M-@}
189Move point to the next error for a different file than the current 172Move point to the next error message or match occurring in a different
190one. 173file (@code{compilation-next-file}).
191@item M-@{ 174@item M-@{
192Move point to the previous error for a different file than the current 175Move point to the previous error message or match occurring in a
193one. 176different file (@code{compilation-previous-file}).
194@item C-c C-f 177@item C-c C-f
195Toggle Next Error Follow minor mode, which makes cursor motion in the 178Toggle Next Error Follow minor mode, which makes cursor motion in the
196compilation buffer produce automatic source display. 179compilation buffer produce automatic source display.
197@end table 180@end table
198 181
199@findex compile-goto-error
200@vindex compilation-auto-jump-to-first-error
201 You can visit the source for any particular error message by moving
202point in the @samp{*compilation*} buffer to that error message and
203typing @key{RET} (@code{compile-goto-error}). Alternatively, you can
204click @kbd{Mouse-2} on the error message; you need not switch to the
205@samp{*compilation*} buffer first. If you set the variable
206@code{compilation-auto-jump-to-first-error} to a non-@code{nil} value,
207Emacs automatically jumps to the first error, if any, as soon as it
208appears in the @samp{*compilation*} buffer.
209
210@kindex M-g M-n 182@kindex M-g M-n
211@kindex M-g n 183@kindex M-g n
212@kindex C-x ` 184@kindex C-x `
213@findex next-error 185@findex next-error
214@vindex next-error-highlight 186@vindex next-error-highlight
215 To parse the compiler error messages sequentially, type @kbd{C-x `} 187 To visit errors sequentially, type @w{@kbd{C-x `}}
216(@code{next-error}). The character following the @kbd{C-x} is the 188(@code{next-error}), or equivalently @kbd{M-g M-n} or @kbd{M-g n}.
217backquote or ``grave accent,'' not the single-quote. This command is 189This command can be invoked from any buffer, not just a Compilation
218available in all buffers, not just in @samp{*compilation*}; it 190mode buffer. The first time you invoke it after a compilation, it
219displays the next error message at the top of one window and source 191visits the locus of the first error message. Each subsequent
220location of the error in another window. It also temporarily 192@w{@kbd{C-x `}} visits the next error, in a similar fashion. If you
221highlights the relevant source line, for a period controlled by the 193visit a specific error with @key{RET} or a mouse click in the
222variable @code{next-error-highlight}. 194@samp{*compilation*} buffer, subsequent @w{@kbd{C-x `}} commands
223 195advance from there. When @w{@kbd{C-x `}} finds no more error messages
224 The first time @w{@kbd{C-x `}} is used after the start of a compilation, 196to visit, it signals an error. @w{@kbd{C-u C-x `}} starts again from
225it moves to the first error's location. Subsequent uses of @kbd{C-x 197the beginning of the compilation buffer, and visits the first locus.
226`} advance down to subsequent errors. If you visit a specific error 198
227message with @key{RET} or @kbd{Mouse-2}, subsequent @w{@kbd{C-x `}} 199 @kbd{M-g M-p} or @kbd{M-g p} (@code{previous-error}) iterates
228commands advance from there. When @w{@kbd{C-x `}} gets to the end of the 200through errors in the opposite direction.
229buffer and finds no more error messages to visit, it fails and signals 201
230an Emacs error. @w{@kbd{C-u C-x `}} starts scanning from the beginning of 202 The @code{next-error} and @code{previous-error} commands don't just
231the compilation buffer, and goes to the first error's location. 203act on the errors or matches listed in @samp{*compilation*} and
204@samp{*grep*} buffers; they also know how to iterate through error or
205match lists produced by other commands, such as @kbd{M-x occur}
206(@pxref{Other Repeating Search}). If you are already in a buffer
207containing error messages or matches, those are the ones that are
208iterated through; otherwise, Emacs looks for a buffer containing error
209messages or matches amongst the windows of the selected frame, then
210for one that @code{next-error} or @code{previous-error} previously
211iterated through, and finally amongst all other buffers. If the
212buffer chosen for iterating through is not currently displayed in a
213window, it will be displayed.
232 214
233@vindex compilation-skip-threshold 215@vindex compilation-skip-threshold
234 By default, @w{@kbd{C-x `}} skips less important messages. The variable 216 By default, the @code{next-error} and @code{previous-error} commands
235@code{compilation-skip-threshold} controls this. If its value is 2, 217skip less important messages. The variable
236@w{@kbd{C-x `}} skips anything less than error, 1 skips anything less 218@code{compilation-skip-threshold} controls this. The default value,
237than warning, and 0 doesn't skip any messages. The default is 1. 2191, means to skip anything less important than a warning. A value of 2
238 220means to skip anything less important than an error, while 0 means not
239 When the window has a left fringe, an arrow in the fringe points to 221to skip any messages.
240the current message in the compilation buffer. The variable 222
241@code{compilation-context-lines} controls the number of lines of 223 When Emacs visits the locus of an error message, it momentarily
242leading context to display before the current message. Going to an 224highlights the relevant source line. The duration of this highlight
243error message location scrolls the @samp{*compilation*} buffer to put 225is determined by the variable @code{next-error-highlight}.
244the message that far down from the top. The value @code{nil} is 226
245special: if there's a left fringe, the window doesn't scroll at all 227@vindex compilation-context-lines
246if the message is already visible. If there is no left fringe, 228 If the @samp{*compilation*} buffer is shown in a window with a left
247@code{nil} means display the message at the top of the window. 229fringe (@pxref{Fringes}), the locus-visiting commands put an arrow in
248 230the fringe, pointing to the current error message. If the window has
249 If you're not in the compilation buffer when you run 231no left fringe, such as on a text-only terminal, these commands scroll
250@code{next-error}, Emacs will look for a buffer that contains error 232the window so that the current message is at the top of the window.
251messages. First, it looks for one displayed in the selected frame, 233If you change the variable @code{compilation-context-lines} to an
252then for one that previously had @code{next-error} called on it, and 234integer value @var{n}, these commands scroll the window so that the
253then at the current buffer. Finally, Emacs looks at all the remaining 235current error message is @var{n} lines from the top, whether or not
254buffers. @code{next-error} signals an error if it can't find any such 236there is a fringe; the default value, @code{nil}, gives the behavior
255buffer. 237described above.
256 238
257@vindex compilation-error-regexp-alist 239@vindex compilation-error-regexp-alist
258@vindex grep-regexp-alist 240@vindex grep-regexp-alist
259 To parse messages from the compiler, Compilation mode uses the 241 To parse messages from the compiler, Compilation mode uses the
260variable @code{compilation-error-regexp-alist} which lists various 242variable @code{compilation-error-regexp-alist} which lists various
261formats of error messages and tells Emacs how to extract the source file 243error message formats and tells Emacs how to extract the locus from
262and the line number from the text of a message. If your compiler isn't 244each. A similar variable, @code{grep-regexp-alist}, tells Emacs how
263supported, you can tailor Compilation mode to it by adding elements to 245to parse output from a @code{grep} command (@pxref{Grep Searching}).
264that list. A similar variable @code{grep-regexp-alist} tells Emacs how
265to parse output of a @code{grep} command.
266 246
267@findex compilation-next-error 247@findex compilation-next-error
268@findex compilation-previous-error 248@findex compilation-previous-error
269@findex compilation-next-file 249@findex compilation-next-file
270@findex compilation-previous-file 250@findex compilation-previous-file
271 Compilation mode also redefines the keys @key{SPC} and @key{DEL} to 251 Compilation mode also defines the keys @key{SPC} and @key{DEL} to
272scroll by screenfuls, and @kbd{M-n} (@code{compilation-next-error}) 252scroll by screenfuls; @kbd{M-n} (@code{compilation-next-error}) and
273and @kbd{M-p} (@code{compilation-previous-error}) to move to the next 253@kbd{M-p} (@code{compilation-previous-error}) to move to the next or
274or previous error message. You can also use @kbd{M-@{} 254previous error message; and @kbd{M-@{} (@code{compilation-next-file})
275(@code{compilation-next-file} and @kbd{M-@}} 255and @kbd{M-@}} (@code{compilation-previous-file}) to move to the next
276(@code{compilation-previous-file}) to move up or down to an error 256or previous error message for a different source file.
277message for a different source file.
278 257
279@cindex Next Error Follow mode 258@cindex Next Error Follow mode
280@findex next-error-follow-minor-mode 259@findex next-error-follow-minor-mode
281 You can type @kbd{C-c C-f} to toggle Next Error Follow mode. In 260 You can type @kbd{C-c C-f} to toggle Next Error Follow mode. In
282this minor mode, ordinary cursor motion in the compilation buffer 261this minor mode, ordinary cursor motion in the compilation buffer
283automatically updates the source buffer. For instance, moving the 262automatically updates the source buffer, i.e.@: moving the cursor over
284cursor to the next error message causes the location of that error to 263an error message causes the locus of that error to be displayed.
285be displayed immediately.
286 264
287 The features of Compilation mode are also available in a minor mode 265 The features of Compilation mode are also available in a minor mode
288called Compilation Minor mode. This lets you parse error messages in 266called Compilation Minor mode. This lets you parse error messages in
289any buffer, not just a normal compilation output buffer. Type @kbd{M-x 267any buffer, not just a normal compilation output buffer. Type
290compilation-minor-mode} to enable the minor mode. This defines the keys 268@kbd{M-x compilation-minor-mode} to enable the minor mode. For
291@key{RET} and @kbd{Mouse-2}, as in the Compilation major mode. 269instance, in an Rlogin buffer (@pxref{Remote Host}), Compilation minor
292 270mode automatically accesses remote source files by FTP (@pxref{File
293 Compilation minor mode works in any buffer, as long as the contents 271Names}).
294are in a format that it understands. In an Rlogin buffer (@pxref{Remote
295Host}), Compilation minor mode automatically accesses remote source
296files by FTP (@pxref{File Names}).
297 272
298@node Compilation Shell 273@node Compilation Shell
299@section Subshells for Compilation 274@section Subshells for Compilation
300 275
301 Emacs uses a shell to run the compilation command, but specifies the 276 The @kbd{M-x compile} command uses a shell to run the compilation
302option for a noninteractive shell. This means, in particular, that 277command, but specifies the option for a noninteractive shell. This
303the shell should start with no prompt. If you find your usual shell 278means, in particular, that the shell should start with no prompt. If
304prompt making an unsightly appearance in the @samp{*compilation*} 279you find your usual shell prompt making an unsightly appearance in the
305buffer, it means you have made a mistake in your shell's init file by 280@samp{*compilation*} buffer, it means you have made a mistake in your
306setting the prompt unconditionally. (This init file's name may be 281shell's init file by setting the prompt unconditionally. (This init
307@file{.bashrc}, @file{.profile}, @file{.cshrc}, @file{.shrc}, or 282file may be named @file{.bashrc}, @file{.profile}, @file{.cshrc},
308various other things, depending on the shell you use.) The shell init 283@file{.shrc}, etc., depending on what shell you use.) The shell init
309file should set the prompt only if there already is a prompt. Here's 284file should set the prompt only if there already is a prompt. Here's
310how to do it in bash: 285how to do it in bash:
311 286
@@ -322,67 +297,80 @@ And here's how to do it in csh:
322if ($?prompt) set prompt = @dots{} 297if ($?prompt) set prompt = @dots{}
323@end example 298@end example
324 299
325 There may well be other things that your shell's init file 300 Emacs does not expect a compiler process to launch asynchronous
326ought to do only for an interactive shell. You can use the same 301subprocesses; if it does, and they keep running after the main
327method to conditionalize them. 302compiler process has terminated, Emacs may kill them or their output
303may not arrive in Emacs. To avoid this problem, make the main
304compilation process wait for its subprocesses to finish. In a shell
305script, you can do this using @samp{$!} and @samp{wait}, like this:
306
307@example
308(sleep 10; echo 2nd)& pid=$! # @r{Record pid of subprocess}
309echo first message
310wait $pid # @r{Wait for subprocess}
311@end example
312
313@noindent
314If the background process does not output to the compilation buffer,
315so you only need to prevent it from being killed when the main
316compilation process terminates, this is sufficient:
317
318@example
319nohup @var{command}; sleep 1
320@end example
328 321
329 The MS-DOS ``operating system'' does not support asynchronous
330subprocesses; to work around this lack, @kbd{M-x compile} runs the
331compilation command synchronously on MS-DOS. As a consequence, you must
332wait until the command finishes before you can do anything else in
333Emacs.
334@iftex
335@inforef{MS-DOS,,emacs-xtra}.
336@end iftex
337@ifnottex 322@ifnottex
338@xref{MS-DOS}. 323 On the MS-DOS ``operating system'', asynchronous subprocesses are
324not supported, so @kbd{M-x compile} runs the compilation command
325synchronously (i.e.@: you must wait until the command finishes before
326you can do anything else in Emacs). @xref{MS-DOS}.
339@end ifnottex 327@end ifnottex
340 328
341@node Grep Searching 329@node Grep Searching
342@section Searching with Grep under Emacs 330@section Searching with Grep under Emacs
343 331
344 Just as you can run a compiler from Emacs and then visit the lines 332 Just as you can run a compiler from Emacs and then visit the lines
345with compilation errors, you can also run @code{grep} and then visit 333with compilation errors, you can also run @command{grep} and then
346the lines on which matches were found. This works by treating the 334visit the lines on which matches were found. This works by treating
347matches reported by @code{grep} as if they were ``errors.'' The 335the matches reported by @command{grep} as if they were ``errors.''
348buffer of matches uses Grep mode, which is a variant of Compilation 336The output buffer uses Grep mode, which is a variant of Compilation
349mode (@pxref{Compilation Mode}). 337mode (@pxref{Compilation Mode}).
350 338
351@table @kbd 339@table @kbd
352@item M-x grep 340@item M-x grep
353@itemx M-x lgrep 341@itemx M-x lgrep
354Run @code{grep} asynchronously under Emacs, with matching lines 342Run @command{grep} asynchronously under Emacs, listing matching lines in
355listed in the buffer named @samp{*grep*}. 343the buffer named @samp{*grep*}.
356@item M-x grep-find 344@item M-x grep-find
357@itemx M-x find-grep 345@itemx M-x find-grep
358@itemx M-x rgrep 346@itemx M-x rgrep
359Run @code{grep} via @code{find}, and collect output in the buffer 347Run @command{grep} via @code{find}, and collect output in the
360named @samp{*grep*}. 348@samp{*grep*} buffer.
361@item M-x zrgrep 349@item M-x zrgrep
362Run @code{zgrep} and collect output in the buffer named @samp{*grep*}. 350Run @code{zgrep} and collect output in the @samp{*grep*} buffer.
363@item M-x kill-grep 351@item M-x kill-grep
364Kill the running @code{grep} subprocess. 352Kill the running @command{grep} subprocess.
365@end table 353@end table
366 354
367@findex grep 355@findex grep
368 To run @code{grep}, type @kbd{M-x grep}, then enter a command line 356 To run @command{grep}, type @kbd{M-x grep}, then enter a command line
369that specifies how to run @code{grep}. Use the same arguments you 357that specifies how to run @command{grep}. Use the same arguments you
370would give @code{grep} when running it normally: a @code{grep}-style 358would give @command{grep} when running it normally: a @command{grep}-style
371regexp (usually in single-quotes to quote the shell's special 359regexp (usually in single-quotes to quote the shell's special
372characters) followed by file names, which may use wildcards. If you 360characters) followed by file names, which may use wildcards. If you
373specify a prefix argument for @kbd{M-x grep}, it finds the tag 361specify a prefix argument for @kbd{M-x grep}, it finds the tag
374(@pxref{Tags}) in the buffer around point, and puts that into the 362(@pxref{Tags}) in the buffer around point, and puts that into the
375default @code{grep} command. 363default @command{grep} command.
376 364
377 Your command need not simply run @code{grep}; you can use any shell 365 Your command need not simply run @command{grep}; you can use any shell
378command that produces output in the same format. For instance, you 366command that produces output in the same format. For instance, you
379can chain @code{grep} commands, like this: 367can chain @command{grep} commands, like this:
380 368
381@example 369@example
382grep -nH -e foo *.el | grep bar | grep toto 370grep -nH -e foo *.el | grep bar | grep toto
383@end example 371@end example
384 372
385 The output from @code{grep} goes in the @samp{*grep*} buffer. You 373 The output from @command{grep} goes in the @samp{*grep*} buffer. You
386can find the corresponding lines in the original files using @w{@kbd{C-x 374can find the corresponding lines in the original files using @w{@kbd{C-x
387`}}, @key{RET}, and so forth, just like compilation errors. 375`}}, @key{RET}, and so forth, just like compilation errors.
388 376
@@ -397,30 +385,31 @@ match will be highlighted, instead of the entire source line.
397 The command @kbd{M-x grep-find} (also available as @kbd{M-x 385 The command @kbd{M-x grep-find} (also available as @kbd{M-x
398find-grep}) is similar to @kbd{M-x grep}, but it supplies a different 386find-grep}) is similar to @kbd{M-x grep}, but it supplies a different
399initial default for the command---one that runs both @code{find} and 387initial default for the command---one that runs both @code{find} and
400@code{grep}, so as to search every file in a directory tree. See also 388@command{grep}, so as to search every file in a directory tree. See also
401the @code{find-grep-dired} command, in @ref{Dired and Find}. 389the @code{find-grep-dired} command, in @ref{Dired and Find}.
402 390
403@findex lgrep 391@findex lgrep
404@findex rgrep 392@findex rgrep
405@findex zrgrep 393@findex zrgrep
406 The commands @kbd{M-x lgrep} (local grep) and @kbd{M-x rgrep} 394 The commands @kbd{M-x lgrep} (local grep) and @kbd{M-x rgrep}
407(recursive grep) are more user-friendly versions of @code{grep} and 395(recursive grep) are more user-friendly versions of @command{grep} and
408@code{grep-find}, which prompt separately for the regular expression 396@code{grep-find}, which prompt separately for the regular expression
409to match, the files to search, and the base directory for the search. 397to match, the files to search, and the base directory for the search.
410Case sensitivity of the search is controlled by the current value of 398Case sensitivity of the search is controlled by the current value of
411@code{case-fold-search}. The command @kbd{M-x zrgrep} is similar to 399@code{case-fold-search}. The command @kbd{M-x zrgrep} is similar to
412@code{rgrep}, but it calls @code{zgrep} instead of @code{grep} to 400@kbd{M-x rgrep}, but it calls @command{zgrep} instead of
413search the contents of gzipped files. 401@command{grep} to search the contents of gzipped files.
414 402
415 These commands build the shell commands based on the variables 403 These commands build the shell commands based on the variables
416@code{grep-template} (for @code{lgrep}) and @code{grep-find-template} 404@code{grep-template} (for @code{lgrep}) and @code{grep-find-template}
417(for @code{rgrep}). The files to search can use aliases defined in 405(for @code{rgrep}). The files to search can use aliases defined in
418the variable @code{grep-files-aliases}. 406the variable @code{grep-files-aliases}.
419 407
420 Subdirectories listed in the variable 408@vindex grep-find-ignored-directories
421@code{grep-find-ignored-directories} such as those typically used by 409 Directories listed in the variable
422various version control systems, like CVS and arch, are automatically 410@code{grep-find-ignored-directories} are automatically skipped by
423skipped by @code{rgrep}. 411@kbd{M-x rgrep}. The default value includes the data directories used
412by various version control systems.
424 413
425@node Flymake 414@node Flymake
426@section Finding Syntax Errors On The Fly 415@section Finding Syntax Errors On The Fly
@@ -444,8 +433,13 @@ flymake-goto-next-error} and @kbd{M-x flymake-goto-prev-error}. To
444display any error messages associated with the current line, use 433display any error messages associated with the current line, use
445@kbd{M-x flymake-display-err-menu-for-current-line}. 434@kbd{M-x flymake-display-err-menu-for-current-line}.
446 435
447 For more details about using Flymake, see @ref{Top, Flymake, 436 For more details about using Flymake,
448Flymake, flymake, The Flymake Manual}. 437@ifnottex
438see @ref{Top, Flymake, Flymake, flymake, The Flymake Manual}.
439@end ifnottex
440@iftex
441see the Flymake Info manual, which is distributed with Emacs.
442@end iftex
449 443
450@node Debuggers 444@node Debuggers
451@section Running Debuggers Under Emacs 445@section Running Debuggers Under Emacs
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index 5905c7a65b2..5336384c3b9 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -39,7 +39,7 @@ developing GNU and promoting software freedom.''
39@c in general, keep the following line commented out, unless doing a 39@c in general, keep the following line commented out, unless doing a
40@c copy of this manual that will be published. The manual should go 40@c copy of this manual that will be published. The manual should go
41@c onto the distribution in the full, 8.5 x 11" size. 41@c onto the distribution in the full, 8.5 x 11" size.
42@smallbook 42@c @smallbook
43 43
44@ifset smallbook 44@ifset smallbook
45@smallbook 45@smallbook
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 8d441f342f0..bb62ad67b2a 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1283,17 +1283,11 @@ for switching graphical windows, so you should type @kbd{C-M-i} or
1283@kbd{@key{ESC} @key{TAB}} instead. 1283@kbd{@key{ESC} @key{TAB}} instead.
1284 1284
1285@cindex tags-based completion 1285@cindex tags-based completion
1286@cindex Info index completion
1287@findex complete-symbol
1288 In-buffer symbol completion generates its completion list in a 1286 In-buffer symbol completion generates its completion list in a
1289number of different ways. In most programming language modes, 1287number of different ways. If Semantic mode is enabled, Emacs tries to
1290completion is normally done using a tags table (@pxref{Tags}). 1288use the Semantic parser data for completion (@pxref{Semantic}). If
1291However, if you supply @kbd{C-M-i} or @kbd{M-@key{TAB}} with a numeric 1289Semantic mode is not enabled or it fails at performing completion,
1292argument, it completes using the Info file indexes for the current 1290Emacs normally tries to complete using a tags table (@pxref{Tags}).
1293language (e.g.@: the C Library Manual). Of course, Info-based
1294completion works only if there is an Info file for the standard
1295library functions of your language, and only if it is installed at
1296your site.
1297 1291
1298@cindex Lisp symbol completion 1292@cindex Lisp symbol completion
1299@cindex completion (Lisp symbols) 1293@cindex completion (Lisp symbols)
@@ -1350,6 +1344,8 @@ have an exact understanding of programming language syntax. This
1350allows Semantic to provide search, navigation, and completion commands 1344allows Semantic to provide search, navigation, and completion commands
1351that are powerful and precise. 1345that are powerful and precise.
1352 1346
1347@cindex Semantic mode
1348@cindex mode, Semantic
1353 To begin using Semantic, type @kbd{M-x semantic-mode} or click on 1349 To begin using Semantic, type @kbd{M-x semantic-mode} or click on
1354the menu item named @samp{Source Code Parsers (Semantic)} in the 1350the menu item named @samp{Source Code Parsers (Semantic)} in the
1355@samp{Tools} menu. This enables Semantic mode, a global minor mode. 1351@samp{Tools} menu. This enables Semantic mode, a global minor mode.