@settitle Ada Mode
@copying
-Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+Copyright @copyright{} 1999--2013 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
is included in the section entitled ``GNU Free Documentation License''.
(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
-modify this GNU manual. Buying copies from the FSF supports it in
-developing GNU and promoting software freedom.''
+modify this GNU manual.''
@end quotation
@end copying
@titlepage
@sp 10
-@title{Ada Mode}
+@title Ada Mode
@sp 2
@subtitle An Emacs major mode for programming in Ada
@subtitle Ada Mode Version 4.00
@contents
-@node Top, Overview, (dir), (dir)
+@node Top
+@top Ada Mode
@ifnottex
@insertcopying
@end menu
-@node Overview, Installation, Top, Top
+@node Overview
@chapter Overview
The Emacs mode for programming in Ada helps the user in understanding
When the Gnu Ada compiler GNAT is used, the cross-reference
information output by the compiler is used to provide powerful code
-navigation (jump to definition, find all uses, etc).
+navigation (jump to definition, find all uses, etc.).
When you open a file with a file extension of @file{.ads} or
@file{.adb}, Emacs will automatically load and activate Ada mode.
See the Emacs info manual, section 'Running Debuggers Under Emacs',
for general information on debugging.
-@node Installation, Customization, Overview, Top
+@node Installation
@chapter Installation
Ada mode is part of the standard Emacs distribution; if you use that,
@end itemize
-@node Customization, Compiling Executing, Installation, Top
+@node Customization
@chapter Customizing Ada mode
Here we assume you are familiar with setting variables in Emacs,
* Other customization::
@end menu
-@node Non-standard file names, Other compiler, Customization, Customization
+@node Non-standard file names
@section Non-standard file names
By default, Ada mode is configured to use the GNAT file naming
names, and the extension for specs and bodies are
@samp{.ads} and @samp{.adb}, respectively.
-Ada mode uses the file extentions to allow moving from a package body
+Ada mode uses the file extensions to allow moving from a package body
to the corresponding spec and back.
Ada mode supports a list of alternative file extensions for specs and bodies.
that ends with either @file{.adb}, @file{_b.ada} or
@file{.body}.
-Simililarly, if Ada mode is looking for a spec, it will look for
+Similarly, if Ada mode is looking for a spec, it will look for
@file{.ads} or @file{_s.ada}.
If the filename is not derived from the Ada name following the GNAT
is beyond the scope of this manual; see the current definitions in
@file{ada-mode.el} and @file{ada-xref.el} for examples.
-@node Other compiler, Other customization, Non-standard file names, Customization
+@node Other compiler
@section Other compiler
By default, Ada mode is configured to use the Gnu Ada compiler GNAT.
Ada mode project files. See @ref{Project file variables} for the list
of project variables, and the corresponding lisp variables.
-@node Other customization, , Other compiler, Customization
+@node Other customization
@section Other customization
All user-settable Ada mode variables can be set via the menu
(setq variable-name value)
@end example
-@node Compiling Executing, Project files, Customization, Top
+@node Compiling Executing
@chapter Compiling Executing
Ada projects can be compiled, linked, and executed using commands on
* Compiler errors::
@end menu
-@node Compile commands, Compiler errors, Compiling Executing, Compiling Executing
+@node Compile commands
@section Compile commands
Here are the commands for building and using an Ada project, as
@end enumerate
-@node Compiler errors, , Compile commands, Compiling Executing
+@node Compiler errors
@section Compiler errors
The @code{Check file}, @code{Compile file}, and @code{Build} commands
references are also clickable in the same way, or put point after the
line number and press @key{RET}.
-@node Project files, Compiling Examples, Compiling Executing, Top
+@node Project files
@chapter Project files
An Emacs Ada mode project file specifies what directories hold sources
* Project file variables::
@end menu
-@node Project File Overview, GUI Editor, Project files, Project files
+@node Project File Overview
@section Project File Overview
Project files have a simple syntax; they may be edited directly. Each
project file. Any other extension is treated as an Emacs Ada mode
project file.
-@node GUI Editor, Project file variables, Project File Overview, Project files
+@node GUI Editor
@section GUI Editor
The project file editor is invoked with the menu @samp{Ada | Projects
buffer, or the @kbd{C-x C-s} binding. To cancel your modifications,
kill the buffer or click on the @samp{[cancel]} button.
-@node Project file variables, , GUI Editor, Project files
+@node Project file variables
@section Project file variables
The following variables can be defined in a project file; some can
ada_project_path=$GDS_ROOT/makerules
ada_project_path=../opentoken
@end example
-the environment variable @code{ADA_PROJECT_PATH} will be set to
-@code{"/home/shared/makerules:/home/opentoken/"}.
+then as a result the environment variable @code{ADA_PROJECT_PATH} will
+be set to @code{"/home/shared/makerules:/home/opentoken/"}.
The default value is not the current value of this environment
variable, because that will typically have been set by another
@end table
-@node Compiling Examples, Moving Through Ada Code, Project files, Top
+@node Compiling Examples
@chapter Compiling Examples
We present several small projects, and walk thru the process of
* Use multiple GNAT project files::
@end menu
-@node No project files, Set compiler options, Compiling Examples, Compiling Examples
+@node No project files
@section No project files
This example uses no project files.
get a @code{*compilation*} buffer containing something like (the
directory paths will be different):
-@example
+@smallexample
cd c:/Examples/Example_1/
gnatmake -u -c -gnatc -g c:/Examples/Example_1/hello.adb -cargs -gnatq -gnatQ
gcc -c -Ic:/Examples/Example_1/ -gnatc -g -gnatq -gnatQ -I- c:/Examples/Example_1/hello.adb
hello.adb:4:04: non-visible declaration at a-textio.ads:264
hello.adb:4:04: non-visible declaration at a-textio.ads:260
gnatmake: "c:/Examples/Example_1/hello.adb" compilation error
-@end example
+@end smallexample
If you have enabled font-lock, the lines with actual errors (starting
with @file{hello.adb}) are highlighted, with the file name in red.
@end enumerate
-@node Set compiler options, Set source search path, No project files, Compiling Examples
+@node Set compiler options
@section Set compiler options
This example illustrates using an Emacs Ada mode project file to set a
Fixing the error, linking and running the code proceed as in @ref{No
project files}.
-@node Set source search path, Use GNAT project file, Set compiler options, Compiling Examples
+@node Set source search path
@section Set source search path
In this example, we show how to deal with files in more than one
Fixing the error, linking and running the code proceed as in @ref{No
project files}.
-@node Use GNAT project file, Use multiple GNAT project files, Set source search path, Compiling Examples
+@node Use GNAT project file
@section Use GNAT project file
In this example, we show how to use a GNAT project file, with no Ada
Build}. You should get a @code{*compilation*} buffer containing
something like (the directory paths will be different):
-@example
+@smallexample
cd c:/Examples/Example_4/Gnat_Project/
gnatmake -o hello_4 hello_4 -Phello_4.gpr -cargs -gnatq -gnatQ -bargs -largs
gcc -c -g -gnatyt -gnatq -gnatQ -I- -gnatA c:\Examples\Example_4\Gnat_Project\hello_4.adb
gcc -c -g -gnatyt -gnatq -gnatQ -I- -gnatA c:\Examples\Example_4\hello_pkg.adb
hello_pkg.adb:2:08: keyword "body" expected here [see file name]
gnatmake: "c:\examples\example_4\hello_pkg.adb" compilation error
-@end example
+@end smallexample
Compare the @code{gcc} options to the compiler output in @ref{Set
compiler options}; this shows that @file{hello_4.gpr} is being used to
Fixing the error, linking and running the code proceed as in @ref{No
project files}.
-@node Use multiple GNAT project files, , Use GNAT project file, Compiling Examples
+@node Use multiple GNAT project files
@section Use multiple GNAT project files
In this example, we show how to use multiple GNAT project files,
Build}. You should get a @code{*compilation*} buffer containing
something like (the directory paths will be different):
-@example
+@smallexample
cd c:/Examples/Example_5/
gnatmake -o hello_5 hello_5 -Phello_5.gpr -g -cargs -gnatq -gnatQ -bargs -largs
gcc -c -g -gnatyt -g -gnatq -gnatQ -I- -gnatA c:\Examples\Example_5\hello_5.adb
gcc -c -g -gnatyt -g -gnatq -gnatQ -I- -gnatA c:\Examples\Example_4\hello_pkg.adb
hello_pkg.adb:2:08: keyword "body" expected here [see file name]
gnatmake: "c:\examples\example_4\hello_pkg.adb" compilation error
-@end example
+@end smallexample
Now type @kbd{C-x `}. @file{Example_4/hello_pkg.adb} is shown,
demonstrating that @file{hello_5.gpr} and @file{hello_4.gpr} are being
used to set the compilation search path.
-@node Moving Through Ada Code, Identifier completion, Compiling Examples, Top
+@node Moving Through Ada Code
@chapter Moving Through Ada Code
There are several easy to use commands to navigate through Ada code. All
will try to run GNAT for you whenever cross-reference information is
needed, and is older than the current source file.
-@node Identifier completion, Automatic Smart Indentation, Moving Through Ada Code, Top
+@node Identifier completion
@chapter Identifier completion
Emacs and Ada mode provide two general ways for the completion of
Complete identifier using buffer information (not Ada-specific).
@end table
-@node Automatic Smart Indentation, Formatting Parameter Lists, Identifier completion, Top
+@node Automatic Smart Indentation
@chapter Automatic Smart Indentation
Ada mode comes with a full set of rules for automatic indentation. You
before inserting a newline, when you press @key{RET}.
@end table
-Most of the time, the indentation will be automatic, i.e when you
+Most of the time, the indentation will be automatic, i.e., when you
press @key{RET}, the cursor will move to the correct column on the
next line.
indentation.
@end table
-@node Formatting Parameter Lists, Automatic Casing, Automatic Smart Indentation, Top
+@node Formatting Parameter Lists
@chapter Formatting Parameter Lists
@table @kbd
argument names and argument types, and aligns the @code{in},
@code{out} and @code{in out} keywords.
-@node Automatic Casing, Statement Templates, Formatting Parameter Lists, Top
+@node Automatic Casing
@chapter Automatic Casing
Casing of identifiers, attributes and keywords is automatically
included, separated from the word by a space.
If the word starts with an asterisk (@key{*}), it defines the casing
-af a word fragemnt (or ``substring''); part of a word between two
+as a word fragment (or ``substring''); part of a word between two
underscores or word boundary.
For example:
@code{ada-case-exception-file} (@code{ada-case-read-exceptions}).
@end table
-@node Statement Templates, Comment Handling, Automatic Casing, Top
+@node Statement Templates
@chapter Statement Templates
Templates are defined for most Ada statements, using the Emacs
type (@code{ada-type}).
@end table
-@node Comment Handling, GNU Free Documentation License, Statement Templates, Top
+@node Comment Handling
@chapter Comment Handling
By default, comment lines get indented like Ada code. There are a few
@item M-j
Continue comment on next line.
@item C-c ;
-Comment the selected region (add -- at the beginning of lines).
+Comment the selected region (add @samp{--} at the beginning of lines).
@item C-c :
Uncomment the selected region
@item M-q
autofill the current comment.
@end table
-@node GNU Free Documentation License, Index, Comment Handling, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Index, , GNU Free Documentation License, Top
+@node Index
@unnumbered Index
@printindex fn
@bye
-
-@ignore
- arch-tag: 68cf0d8a-55cc-4190-a28d-4984fa56ed1e
-@end ignore