]> code.delx.au - gnu-emacs/blobdiff - man/building.texi
Version 4.28
[gnu-emacs] / man / building.texi
index 50490e34dd5f1d7760a5ef2bf707833a192b3d12..2182cccd8b94d1e53904c41c91c97c76b126ad77 100644 (file)
@@ -18,6 +18,7 @@ in the larger process of developing and maintaining programs.
 * Compilation Shell::   Customizing your shell properly
                           for use in the compilation buffer.
 * Grep Searching::      Searching with grep.
+* Flymake::             Finding syntax errors on the fly.
 * Debuggers::          Running symbolic debuggers for non-Lisp programs.
 * Executing Lisp::      Various modes for editing Lisp programs,
                           with different facilities for running
@@ -116,8 +117,11 @@ that is running.  You can also kill the compilation process with
 
 @findex recompile
   To rerun the last compilation with the same command, type @kbd{M-x
-recompile}.  This automatically reuses the compilation command from the
-last invocation of @kbd{M-x compile}.
+recompile}.  This automatically reuses the compilation command from
+the last invocation of @kbd{M-x compile}.  It also reuses the
+@samp{*compilation*} buffer and starts the compilation in its default
+directory, which is the directory in which the previous compilation
+was started.
 
   Emacs does not expect a compiler process to launch asynchronous
 subprocesses; if it does, and they keep running after the main
@@ -162,8 +166,13 @@ non-@code{nil} value, then the compilation buffer always scrolls to
 follow output as it comes in.
 
 @table @kbd
-@item C-x `
+@item M-g M-n
+@itemx M-g n
+@itemx C-x `
 Visit the locus of the next compiler error message or @code{grep} match.
+@item M-g M-p
+@itemx M-g p
+Visit the locus of the previous compiler error message or @code{grep} match.
 @item @key{RET}
 Visit the locus of the error message that point is on.
 This command is used in the compilation buffer.
@@ -186,6 +195,8 @@ Toggle Next Error Follow minor mode, which makes cursor motion in the
 compilation buffer produce automatic source display.
 @end table
 
+@kindex M-g M-n
+@kindex M-g n
 @kindex C-x `
 @findex next-error
   You can visit the source for any particular error message by moving
@@ -212,6 +223,14 @@ commands advance from there.  When @kbd{C-x `} gets to the end of the
 buffer and finds no more error messages to visit, it fails and signals
 an Emacs error.
 
+When the left fringe is displayed, an arrow points to the
+current message in the compilation buffer. The variable
+@code{compilation-context-lines} controls the number of lines of
+leading context in the window before the current message.  If it is
+@code{nil} and the left fringe is displayed, the window doesn't
+scroll.  If there is no left fringe, no arrow is displayed and a value
+of @code{nil} means display the message at the top of the window.
+
   You don't have to be in the compilation buffer in order to use
 @code{next-error}.  If one window on the selected frame can be the
 target of the @code{next-error} call, it is used.  Else, if a buffer
@@ -337,6 +356,31 @@ initial default for the command---one that runs both @code{find} and
 @code{grep}, so as to search every file in a directory tree.  See also
 the @code{find-grep-dired} command, in @ref{Dired and Find}.
 
+@node Flymake
+@section Finding Syntax Errors On The Fly
+@cindex checking syntax
+
+  Flymake mode is a minor mode that performs on-the-fly syntax
+checking for many programming and markup languages, including C, C++,
+Perl, HTML, and @TeX{}/La@TeX{}.  It is somewhat analogous to Flyspell
+mode, which performs spell checking for ordinary human languages in a
+similar fashion (@pxref{Spelling}).  As you edit a file, Flymake mode
+runs an appropriate syntax checking tool in the background, using a
+temporary copy of the buffer.  It then parses the error and warning
+messages, and highlights the erroneous lines in the buffer.  The
+syntax checking tool used depends on the language; for example, for
+C/C++ files this is usually the C compiler.  Flymake can also use
+build tools such as @code{make} for checking complicated projects.
+
+  To activate Flymake mode, type @kbd{M-x flymake-mode}.  You can move
+to the errors spotted by Flymake mode with @kbd{M-x
+flymake-goto-next-error} and @kbd{M-x flymake-goto-prev-error}.  To
+display any error messages associated with the current line, use
+@kbd{M-x flymake-display-err-menu-for-current-line}.
+
+  For more details about using Flymake, see @ref{Top, Flymake,
+Flymake, flymake, The Flymake Manual}.
+
 @node Debuggers
 @section Running Debuggers Under Emacs
 @cindex debuggers
@@ -458,13 +502,23 @@ history commands to repeat them.  @xref{Shell Mode}.
 
 @cindex tooltips with GUD
 @vindex tooltip-gud-modes
-@vindex tooltip-gud-tips-p
+@vindex gud-tooltip-mode
+@vindex gud-tooltip-echo-area
   The Tooltip facility (@pxref{Tooltips}) provides support for GUD@.
-You activate this feature by setting the variable
-@code{tooltip-gud-tips-p} to @code{t}.  Then you can display a
-variable's value in a tooltip simply by pointing at it with the mouse.
-This operates in the GUD buffer and in source buffers with major modes
-in the list @code{tooltip-gud-modes}.
+You activate this feature by turning on the minor mode
+@code{gud-tooltip-mode}.  Then you can display a variable's value in a
+tooltip simply by pointing at it with the mouse.  In graphical mode,
+with a C program, you can also display the @code{#define} directive
+associated with an identifier when the program is not executing.  This
+operates in the GUD buffer and in source buffers with major modes in
+the list @code{gud-tooltip-modes}.  If the variable
+@code{gud-tooltip-echo-area} is non-@code{nil} then the variable's
+value is displayed in the echo area.
+
+With GDB in text command mode (@pxref{GDB Graphical Interface}),
+it is possible that use of GUD tooltips can cause a function to be
+called with harmful side-effects.  In this case, Emacs disables
+gud-tooltip-mode.
 
 @node Commands of GUD
 @subsection Commands of GUD
@@ -474,7 +528,7 @@ commands of Shell mode are available (@pxref{Shell Mode}).  GUD mode
 also provides commands for setting and clearing breakpoints, for
 selecting stack frames, and for stepping through the program.  These
 commands are available both in the GUD buffer and globally, but with
-different key bindings.  It also has its own toolbar from which you
+different key bindings.  It also has its own tool bar from which you
 can invoke the more common commands by clicking on the appropriate
 icon.  This is particularly useful for repetitive commands like
 gud-next and gud-step and allows the user to hide the GUD buffer.
@@ -701,7 +755,7 @@ that line, this action will remove it
 (@code{gdb-mouse-set-clear-breakpoint}). Where Emacs uses the margin
 to display breakpoints, it is also possible to enable or disable them
 when you click @kbd{Mouse-3} there
-(@code{gdb-mouse-toggle--breakpoint}).
+(@code{gdb-mouse-toggle-breakpoint}).
 
 @vindex gud-gdb-command-name
 @findex gdba
@@ -828,7 +882,7 @@ the variables that are local to the new frame.
 
 If you want to see how a variable changes each time your program stops
 then place the cursor over the variable name and click on the watch
-icon in the toolbar (@code{gud-watch}).
+icon in the tool bar (@code{gud-watch}).
 
 Each watch expression is displayed in the speedbar.  Complex data
 types, such as arrays, structures and unions are represented in a tree
@@ -874,7 +928,7 @@ current frame for simple data types (@pxref{Frame Info,,, gdb, The GNU
 debugger}).
 
 Arrays and structures display their type only.  You must display them
-separately to examine their values.  @ref{Watch Expressions}.
+separately to examine their values.  @xref{Watch Expressions}.
 
 @item Registers Buffer
 The registers buffer displays the values held by the registers