Mercurial > emacs
annotate man/ada-mode.texi @ 73963:4ccb00e24c09 mh-e-8_0_3 mh-e-doc-8_0_3
*** empty log message ***
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Mon, 13 Nov 2006 05:31:27 +0000 |
parents | c2808e06f0d0 |
children | ad6a503ca867 7eeafaaa9eab |
rev | line source |
---|---|
25906 | 1 \input texinfo @c -*-texinfo-*- |
25913
2552233fdd74
Set file name to ../info/ada-mode
Gerd Moellmann <gerd@gnu.org>
parents:
25906
diff
changeset
|
2 @setfilename ../info/ada-mode |
25906 | 3 @settitle Ada Mode |
4 | |
37403 | 5 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
6 @comment The following lines inserts the copyright notice | |
7 @comment into the Info file. | |
8 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
25906 | 9 |
47737
0a70200bde27
use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents:
46918
diff
changeset
|
10 @copying |
64890
3723093a21fd
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
52401
diff
changeset
|
11 Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, |
69681
11b616eddda4
@copyright{}, no indentation in @copying{}
Karl Berry <karl@gnu.org>
parents:
68639
diff
changeset
|
12 2005, 2006 Free Software Foundation, Inc. |
25906 | 13 |
47737
0a70200bde27
use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents:
46918
diff
changeset
|
14 @quotation |
37403 | 15 Permission is granted to copy, distribute and/or modify this document |
65555
69b3598a61c5
Update all manuals to specify GFDL version 1.2.
Romain Francoise <romain@orebokech.com>
parents:
64890
diff
changeset
|
16 under the terms of the GNU Free Documentation License, Version 1.2 or |
37403 | 17 any later version published by the Free Software Foundation; with the |
18 Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and | |
19 ``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU | |
20 Manual'', and with the Back-Cover Texts as in (a) below. A copy of the | |
21 license is included in the section entitled ``GNU Free Documentation | |
22 License'' in the Emacs manual. | |
25906 | 23 |
37403 | 24 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify |
25 this GNU Manual, like GNU software. Copies published by the Free | |
26 Software Foundation raise funds for GNU development.'' | |
25906 | 27 |
37403 | 28 This document is part of a collection distributed under the GNU Free |
29 Documentation License. If you want to distribute this document | |
30 separately from the collection, you can do so by adding a copy of the | |
31 license to the document, as described in section 6 of the license. | |
47737
0a70200bde27
use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents:
46918
diff
changeset
|
32 @end quotation |
0a70200bde27
use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents:
46918
diff
changeset
|
33 @end copying |
37403 | 34 |
47737
0a70200bde27
use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents:
46918
diff
changeset
|
35 @dircategory Emacs |
0a70200bde27
use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents:
46918
diff
changeset
|
36 @direntry |
0a70200bde27
use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents:
46918
diff
changeset
|
37 * Ada mode: (ada-mode). Emacs mode for editing Ada code. |
0a70200bde27
use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents:
46918
diff
changeset
|
38 @end direntry |
25906 | 39 |
40 @titlepage | |
41 @sp 10 | |
42 @title{Ada Mode} | |
43 @sp 2 | |
44 @subtitle An Emacs major mode for programming Ada 95 with GNAT | |
45 @subtitle July 1998 for Ada Mode Version 3.0 | |
46 @sp 2 | |
47 @page | |
48 @vskip 0pt plus 1filll | |
47737
0a70200bde27
use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents:
46918
diff
changeset
|
49 @insertcopying |
37403 | 50 @end titlepage |
25906 | 51 |
52 | |
53 @node Top, Overview, (dir), (dir) | |
54 | |
55 @menu | |
56 * Overview:: | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
57 * Installation:: Installing Ada mode on your system |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
58 * Customization:: Setting up Ada mode to your taste |
25906 | 59 * Project files:: Describing the organization of your project |
60 * Syntax highlighting:: Using specific colors and fonts to highlight | |
61 the structure of your files | |
62 * Moving Through Ada Code:: Moving easily through Ada sources | |
63 * Identifier completion:: Finishing words automatically | |
64 * Index Menu of Subprograms:: A menu of all the types and subprograms | |
65 defined in your application | |
66 * File Browser:: Easy access to your files | |
67 * Automatic Smart Indentation:: Indenting your code automatically as you type | |
46918
82d113655734
Minor spelling and grammar corrections.
Paul Eggert <eggert@twinsun.com>
parents:
43961
diff
changeset
|
68 * Formatting Parameter Lists:: Formatting subprograms' parameter lists |
25906 | 69 automatically |
70 * Automatic Casing:: Adjusting the case of words automatically | |
71 * Statement Templates:: Inserting code templates | |
72 * Comment Handling:: Reformatting comments easily | |
73 * Compiling Executing:: Working with your application within Emacs | |
74 * Debugging:: Debugging your application | |
75 * Using non-standard file names:: Configuring Emacs for special file names | |
76 * Working Remotely:: Working on a different machine | |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
77 * Index:: |
25906 | 78 @end menu |
79 | |
80 | |
81 @c ----------------------------------------------------------------------- | |
82 @node Overview, Installation, Top, Top | |
83 @chapter Overview | |
84 @c ----------------------------------------------------------------------- | |
85 | |
86 The Emacs mode for programming in Ada 95 with GNAT helps the user in | |
87 understanding existing code and facilitates writing new code. It | |
88 furthermore provides some utility functions for easier integration of | |
89 standard Emacs features when programming in Ada. | |
90 | |
91 @section General features: | |
92 | |
93 @itemize @bullet | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
94 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
95 full Integrated Development Environment: |
25906 | 96 @itemize @bullet |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
97 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
98 support of ``project files'' for the configuration (directories, |
25906 | 99 compilation options,...) |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
100 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
101 compiling and stepping through error messages. |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
102 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
103 running and debugging your applications within Emacs. |
25906 | 104 @end itemize |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
105 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
106 easy to use for beginners by pull-down menus, |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
107 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
108 user configurable by many user-option variables. |
25906 | 109 @end itemize |
110 | |
111 @section Ada mode features that help understanding code: | |
112 | |
113 @itemize @bullet | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
114 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
115 functions for easy and quick stepping through Ada code, |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
116 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
117 getting cross reference information for identifiers (e.g. find the |
25906 | 118 defining place by a keystroke), |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
119 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
120 displaying an index menu of types and subprograms and move point to |
25906 | 121 the chosen one, |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
122 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
123 automatic color highlighting of the various entities in Ada code. |
25906 | 124 @end itemize |
125 | |
126 @section Emacs support for writing Ada code: | |
127 | |
128 @itemize @bullet | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
129 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
130 switching between spec and body files with eventually |
25906 | 131 auto-generation of body files, |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
132 @item |
46918
82d113655734
Minor spelling and grammar corrections.
Paul Eggert <eggert@twinsun.com>
parents:
43961
diff
changeset
|
133 automatic formatting of subprograms' parameter lists. |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
134 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
135 automatic smart indentation according to Ada syntax, |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
136 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
137 automatic completion of identifiers, |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
138 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
139 automatic casing of identifiers, keywords, and attributes, |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
140 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
141 insertion of statement templates, |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
142 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
143 filling comment paragraphs like filling normal text, |
25906 | 144 @end itemize |
145 | |
146 @c ----------------------------------------------------------------------- | |
147 @node Installation, Customization, Overview, Top | |
148 @chapter Installation | |
149 @c ----------------------------------------------------------------------- | |
150 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
151 If you got Ada mode as a separate distribution, you should have a |
25906 | 152 look at the @file{README} file. It explains the basic steps necessary |
153 for a good installation of the emacs Ada mode. | |
154 | |
155 Installing the Ada mode is basically just a matter of copying a few | |
156 files into the Emacs library directories. Every time you open a file | |
157 with a file extension of @file{.ads} or @file{.adb}, Emacs will | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
158 automatically load and activate Ada mode. |
25906 | 159 |
42326
939fbbfd59d8
Fix typo in cross-reference for `Using non-standard file names'
Robert J. Chassell <bob@rattlesnake.com>
parents:
40705
diff
changeset
|
160 @xref{Using non-standard file names}, if your files do |
25906 | 161 not use these extensions and if you want Emacs to automatically start the |
162 Ada mode every time you edit an Ada file. | |
163 | |
42326
939fbbfd59d8
Fix typo in cross-reference for `Using non-standard file names'
Robert J. Chassell <bob@rattlesnake.com>
parents:
40705
diff
changeset
|
164 Also, for general usage variables that you might want to set, |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47737
diff
changeset
|
165 see |
42326
939fbbfd59d8
Fix typo in cross-reference for `Using non-standard file names'
Robert J. Chassell <bob@rattlesnake.com>
parents:
40705
diff
changeset
|
166 @iftex |
939fbbfd59d8
Fix typo in cross-reference for `Using non-standard file names'
Robert J. Chassell <bob@rattlesnake.com>
parents:
40705
diff
changeset
|
167 @cite{The GNU Emacs Manual}. |
939fbbfd59d8
Fix typo in cross-reference for `Using non-standard file names'
Robert J. Chassell <bob@rattlesnake.com>
parents:
40705
diff
changeset
|
168 @end iftex |
939fbbfd59d8
Fix typo in cross-reference for `Using non-standard file names'
Robert J. Chassell <bob@rattlesnake.com>
parents:
40705
diff
changeset
|
169 @ifhtml |
939fbbfd59d8
Fix typo in cross-reference for `Using non-standard file names'
Robert J. Chassell <bob@rattlesnake.com>
parents:
40705
diff
changeset
|
170 @cite{The GNU Emacs Manual}. |
939fbbfd59d8
Fix typo in cross-reference for `Using non-standard file names'
Robert J. Chassell <bob@rattlesnake.com>
parents:
40705
diff
changeset
|
171 @end ifhtml |
939fbbfd59d8
Fix typo in cross-reference for `Using non-standard file names'
Robert J. Chassell <bob@rattlesnake.com>
parents:
40705
diff
changeset
|
172 @ifinfo |
939fbbfd59d8
Fix typo in cross-reference for `Using non-standard file names'
Robert J. Chassell <bob@rattlesnake.com>
parents:
40705
diff
changeset
|
173 @ref{Top, , The GNU Emacs Manual, emacs, The GNU Emacs Manual}. |
939fbbfd59d8
Fix typo in cross-reference for `Using non-standard file names'
Robert J. Chassell <bob@rattlesnake.com>
parents:
40705
diff
changeset
|
174 @end ifinfo |
25906 | 175 |
176 @c --------------------------------------------------------------------- | |
177 @section Required files | |
178 @c --------------------------------------------------------------------- | |
179 | |
180 This Ada mode works best with Emacs 20.3 or higher (the easy editing | |
181 features for the project files won't work with any older version), but | |
182 most of the commands should work with older versions too. Please try to | |
183 install the most recent version of Emacs on your system before | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
184 installing Ada mode. |
25906 | 185 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
186 Although part of Ada mode is compiler-independent, the most advanced |
25906 | 187 features are specific to the Gnat compiler @url{http://www.gnat.com}. |
188 | |
189 The following files are provided with the Ada mode distribution: | |
190 | |
191 @itemize @bullet | |
192 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
193 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
194 @file{ada-mode.el}: The main file for Ada mode. |
25906 | 195 This is the only file which does not require Gnat. It contains the |
196 functions for indentation, formatting of parameter lists, stepping | |
197 through code, comment handling and automatic casing. Emacs versions | |
198 20.2 and higher already contain Ada mode version 2.27, which is an older | |
199 version of this file and should be replaced. Loading @file{ada-mode.el} | |
200 from the current distribution supersedes the standard installation. | |
201 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
202 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
203 @file{ada-stmt.el}: Contains the statement templates feature. |
25906 | 204 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
205 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
206 @file{ada-xref.el}: This file provides the main support for Gnat. |
25906 | 207 This is where the functions for cross-references, completion of |
208 identifiers, support for project files and compilation of your | |
209 application are defined. | |
210 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
211 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
212 @file{ada-prj.el}: The functions to use for easy-edition of the |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
213 project files. This file is the only one which really requires Emacs |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
214 at least 20.2. It uses the new widget features from Emacs. |
25906 | 215 |
216 @end itemize | |
217 | |
218 @c -------------------------------------------------------------------- | |
219 @node Customization, Project files, Installation, Top | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
220 @chapter Customizing Ada mode |
25906 | 221 @c --------------------------------------------------------------------- |
222 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
223 Ada mode is fully customizable. Everything, from the file names to |
25906 | 224 the automatic indentation and the automatic casing can be adapted to |
225 your own needs. | |
226 | |
227 There are two different kinds of variables that control this | |
228 customization, both are easy to modify. | |
229 | |
230 The first set of variables are standard Emacs variables. Of course, some | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
231 are defined only for Ada mode, whereas others have a more general |
25906 | 232 meaning in Emacs. Please see the Emacs documentation for more |
233 information on the latest. In this documentation, we will detail all the | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
234 variables that are specific to Ada mode, and a few others. The names |
25906 | 235 will be given, as in @code{ada-case-identifier}. |
236 | |
237 Emacs provides an easy way to modify them, through a special mode called | |
238 customization. To access this mode, select the menu | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
239 @samp{Ada->Customize}. This will open a new buffer with some fields that |
25906 | 240 you can edit. For instance, you will get something like: |
241 @example | |
242 Put below the compiler switches. | |
243 comp_opt= _____________________________________ | |
244 @end example | |
245 The first line gives a brief description of the variable. The second | |
246 line is the name of the variable and the field where you can give a | |
247 value for this variable. Simply type what you want in the field. | |
248 | |
249 When you are finished modifying the variables, you can simply click on | |
250 the @b{Save for future sessions} button at the top of the buffer (click | |
251 with the middle mouse button). This will save the values in your | |
252 @file{.emacs} file, so that next time you start Emacs they will have the | |
253 same values. | |
254 | |
255 To modify a specific variable, you can directly call the function | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
256 @code{customize-variable} from Emacs (just type @kbd{M-x |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
257 customize-variable @key{RET} @var{variable-name} @key{RET}}). |
25906 | 258 |
259 Some users might prefer to modify the variables directly in their | |
260 configuration file, @file{.emacs}. This file is coded in Emacs lisp, and | |
261 the syntax to set a variable is the following: | |
262 @example | |
263 (setq variable-name value) | |
264 @end example | |
265 | |
266 The second set of variables for customization are set through the use of | |
267 project files. These variables are specific to a given project, whereas | |
268 the first set was more general. For more information, please | |
269 @xref{Project files}. | |
270 | |
271 @c --------------------------------------------------------------------- | |
272 @node Project files, Syntax highlighting, Customization, Top | |
273 @chapter Project files | |
274 @c --------------------------------------------------------------------- | |
275 | |
276 @c --------------------------------------------------------------------- | |
277 @section General overview | |
278 @c --------------------------------------------------------------------- | |
279 | |
280 Emacs provides a full Integrated Development Environment for GNAT and | |
281 Ada programmers. That is to say, editing, compiling, executing and | |
282 debugging can be performed within Emacs in a convenient and natural way. | |
283 | |
284 To take full advantage of this features, it is possible to create a file | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
285 in the main directory of your application, with a @samp{.adp} extension. |
73494
c2808e06f0d0
* ada-mode.texi (Project files, Identifier completion)
Chong Yidong <cyd@stupidchicken.com>
parents:
69681
diff
changeset
|
286 This file contains all needed information dealing with the way your |
25906 | 287 application is organized between directories, the commands to compile, |
288 run and debug it etc. Creating this file is not mandatory and convenient | |
289 defaults are automatically provided for simple setups. It only becomes | |
290 necessary when those above mentioned defaults need customizing. | |
291 | |
292 A simple way to edit this file is provided for Emacs 20.2 or newer, with | |
293 the following functions, that you can access also through the Ada | |
294 menu. It is also possible to edit the project file as a regular text | |
295 file. | |
296 | |
297 Once in the buffer for editing the project file, you can save your | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
298 modification using the @samp{[OK]} button at the bottom of the buffer, or |
25906 | 299 simply use the usual @kbd{C-x C-s} binding. To cancel your |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
300 modifications, simply kill the buffer or click on the @samp{[CANCEL]} button |
25906 | 301 at the button. |
302 | |
303 Each buffer using Ada mode will be associated with one project file when | |
304 there is one available, so that Emacs can easily navigate through | |
305 related source files for instance. | |
306 | |
307 The exact algorithm to determine which project file should be used is | |
308 described in the next section, but you can force the project file you | |
309 want to use by setting one or two variables in your @file{.emacs} file. | |
310 | |
311 @itemize @bullet | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
312 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
313 To set up a default project file to use for any directory, anywhere |
25906 | 314 on your system, set the variable @code{ada-prj-default-project-file} to |
315 the name of that file. | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
316 |
25906 | 317 @example |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
318 (set 'ada-prj-default-project-file "/dir1/dir2/file") |
25906 | 319 @end example |
320 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
321 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
322 For finer control, you can set a per-directory project file. |
25906 | 323 This is done through the variable @code{ada-xref-default-prj-file}. |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
324 |
25906 | 325 @example |
326 (set 'ada-xref-default-prj-file | |
327 '(("/dir1/dir2" . "/dir3/file1") | |
328 ("/dir4/dir5" . "/dir6/file2"))) | |
329 @end example | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
330 |
25906 | 331 Note: This has a higher priority than the first variable, so the first |
73494
c2808e06f0d0
* ada-mode.texi (Project files, Identifier completion)
Chong Yidong <cyd@stupidchicken.com>
parents:
69681
diff
changeset
|
332 choice is to use this variable's settings, and otherwise |
25906 | 333 @code{ada-prj-default-project-file}. |
334 @end itemize | |
335 | |
336 | |
337 @table @kbd | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
338 @item C-c u |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
339 @findex ada-customize |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
340 Create or edit the project file for the current buffer (@code{ada-customize}). |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47737
diff
changeset
|
341 @item C-c c |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
342 @findex ada-change-prj |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
343 Change the project file associated with the current Ada buffer (@code{ada-change-prj}). |
25906 | 344 @item C-c d |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
345 @findex ada-change-default-project |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
346 Change the default project file for the current directory |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
347 (@code{ada-change-default-project}). Every new file opened from this |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
348 directory will be associated with that file by default. |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
349 @item ada-set-default-project-file |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
350 @findex ada-set-default-project-file |
25906 | 351 Set the default project file to use for *any* Ada file opened anywhere |
352 on your system. This sets this file only for the current Emacs session. | |
353 @end table | |
354 | |
355 @c --------------------------------------------------------------------- | |
356 @section Project file variables | |
357 @c --------------------------------------------------------------------- | |
358 | |
359 The following variables can be defined in a project file. They all have | |
360 a default value, so that small projects do not need to create a project | |
361 file. | |
362 | |
363 Some variables below can be referenced in other variables, using a | |
364 shell-like notation. For instance, if the variable @code{comp_cmd} | |
365 contains a sequence like @code{$@{comp_opt@}}, the value of that variable | |
366 will be substituted. | |
367 | |
368 Here is the list of variables: | |
369 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
370 @table @asis |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
371 @item @code{src_dir} [default: @code{"./"}] |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
372 This is a list of directories where Ada mode will look for source |
25906 | 373 files. These directories are used mainly in two cases, both as a switch |
374 for the compiler and for the cross-references. | |
375 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
376 @item @code{obj_dir} [default: @code{"./"}] |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
377 This is a list of directories where to look for object and library |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
378 files. The library files are the @samp{.ali} files generated by Gnat |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
379 and that contain cross-reference informations. |
25906 | 380 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
381 @item @code{comp_opt} [default: @code{""}] |
25906 | 382 Creates a variable which can be referred to subsequently by using the |
383 @code{$@{comp_opt@}} notation. This is intended to store the default | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
384 switches given to @command{gnatmake} and @command{gcc}. |
25906 | 385 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
386 @item @code{bind_opt=@var{switches}} [default: @code{""}] |
25906 | 387 Creates a variable which can be referred to subsequently by using the |
388 @code{$@{bind_opt@}} notation. This is intended to store the default | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
389 switches given to @command{gnatbind}. |
25906 | 390 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
391 @item @code{link_opt=@var{switches}} [default: @code{""}] |
25906 | 392 Creates a variable which can be referred to subsequently by using the |
393 @code{$@{link_opt@}} notation. This is intended to store the default | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
394 switches given to @command{gnatlink}. |
25906 | 395 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
396 @item @code{main=@var{executable}} [default: @code{""}] |
25906 | 397 Specifies the name of the executable for the application. This variable |
398 can be referred to in the following lines by using the @code{$@{main@}} | |
399 notation. | |
400 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
401 @item @code{cross_prefix=@var{prefix}} [default: @code{""}] |
25906 | 402 This variable should be set if you are working in a cross-compilation |
403 environment. This is the prefix used in front of the gnatmake commands. | |
404 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
405 @item @code{remote_machine=@var{machine}} [default: @code{""}] |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
406 This is the name of the machine to log into before issuing the |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
407 compilation command. If this variable is empty, the command will be |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
408 run on the local machine. This will not work on Windows NT machines, |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
409 since Ada mode will simply precede the compilation command with a |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
410 @command{rsh} command, unknown on Windows. |
25906 | 411 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
412 @item @code{comp_cmd=@var{command}} [default: @code{"$@{cross_prefix@}gcc -c -I$@{src_dir@} -g -gnatq"}] |
25906 | 413 Specifies the command used to compile a single file in the application. |
414 The name of the file will be added at the end of this command. | |
415 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
416 @item @code{make_cmd=@var{command}} [default: @code{"$@{cross_prefix@}gnatmake $@{main@} -aI$@{src_dir@} -aO$@{obj_dir@} -g -gnatq -cargs $@{comp_opt@} -bargs $@{bind_opt@} -largs $@{link_opt@}"]}' |
25906 | 417 Specifies the command used to recompile the whole application. |
418 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
419 @item @code{run_cmd=@var{command}} [default: @code{"$@{main@}"}] |
25906 | 420 Specifies the command used to run the application. |
421 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
422 @item @code{debug_cmd=@var{command}} [default: @code{"$@{cross_prefix@}gdb $@{main@}"}] |
25906 | 423 Specifies the command used to debug the application |
424 | |
425 @end table | |
426 | |
427 @c --------------------------------------------------------------------- | |
428 @section Detailed algorithm | |
429 @c --------------------------------------------------------------------- | |
430 | |
431 This section gives more details on the project file setup and is only of | |
432 interest for advanced users. | |
433 | |
434 Usually, an Ada file is part of a larger application, whose sources and | |
435 objects can be spread over multiple directories. The first time emacs is | |
436 asked to compile, run or debug an application, or when a cross reference | |
437 function is used (goto declaration for instance), the following steps | |
438 are taken: | |
439 | |
440 @itemize @bullet | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
441 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
442 find the appropriate project file, open and parse it. |
25906 | 443 All the fields read in the project file are then stored by emacs |
444 locally. Finding the project file requires a few steps: | |
445 | |
446 @itemize @minus | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
447 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
448 if a file from the same directory was already associated with |
25906 | 449 a project file, use the same one. This is the variable |
450 @code{ada-xref-default-prj-file} described above. | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
451 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
452 if the variable @code{ada-prj-default-project-file} is set, |
25906 | 453 use the project file specified in this variable. |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
454 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
455 if there is a project file whose name is the same as the source file |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
456 except for the suffix, use this one. |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
457 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
458 if there's only one project file in the source directory, use |
25906 | 459 that one. |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
460 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
461 if there are more than one project file in the source directory, |
25906 | 462 ask the user. |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
463 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
464 if there are no project files in the source directory use standard |
25906 | 465 default values. |
466 @end itemize | |
467 | |
468 The first project file that is selected in a given directory becomes the | |
469 default project file for this directory and is used implicitly for other | |
470 sources unless specified otherwise by the user. | |
471 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
472 @item |
38881
ef5cc490984d
Fix a few minor markup errors.
Eli Zaretskii <eliz@gnu.org>
parents:
38864
diff
changeset
|
473 look for the corresponding @samp{.ali} file in the @code{obj_dir} defined |
25906 | 474 in the project file. If this file can not be found, emacs proposes to |
475 compile the source using the @code{comp_cmd} defined in the project file | |
476 in order to create the ali file. | |
477 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
478 @item |
38881
ef5cc490984d
Fix a few minor markup errors.
Eli Zaretskii <eliz@gnu.org>
parents:
38864
diff
changeset
|
479 when cross referencing is requested, the @samp{.ali} file is parsed to |
25906 | 480 determine the file and line of the identifier definition. It is |
38881
ef5cc490984d
Fix a few minor markup errors.
Eli Zaretskii <eliz@gnu.org>
parents:
38864
diff
changeset
|
481 possible for the @samp{.ali} file to be older than the source file, |
ef5cc490984d
Fix a few minor markup errors.
Eli Zaretskii <eliz@gnu.org>
parents:
38864
diff
changeset
|
482 in which case it will be recompiled if the variable |
ef5cc490984d
Fix a few minor markup errors.
Eli Zaretskii <eliz@gnu.org>
parents:
38864
diff
changeset
|
483 @code{ada-xref-create-ali} is set, otherwise the reference is searched |
ef5cc490984d
Fix a few minor markup errors.
Eli Zaretskii <eliz@gnu.org>
parents:
38864
diff
changeset
|
484 in the obsolete ali file with possible inaccurate results. |
25906 | 485 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
486 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
487 look for the file containing the declaration using the source |
25906 | 488 path @code{src_dir} defined in the project file. Put the cursor at the |
489 correct position and display this new cursor. | |
490 @end itemize | |
491 | |
492 @c ----------------------------------------------------------------------- | |
493 @node Syntax highlighting, Moving Through Ada Code, Project files, Top | |
494 @chapter Syntax highlighting | |
495 @c ----------------------------------------------------------------------- | |
496 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
497 Ada mode is made to help you understand the structure of your source |
25906 | 498 files. Some people like having colors or different fonts depending on |
499 the context: commands should be displayed differently than keywords, | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
500 which should also be different from strings, @dots{} |
25906 | 501 |
502 Emacs is able to display in a different way the following syntactic | |
503 entities: | |
504 | |
505 @itemize @bullet | |
506 @item keywords | |
507 @item commands | |
508 @item strings | |
509 @item gnatprep statements (preprocessor) | |
510 @item types (under certain conditions) | |
511 @item other words | |
512 @end itemize | |
513 | |
514 This is not the default behavior for Emacs. You have to explicitly | |
515 activate it. This requires that you add a new line in your @file{.emacs} | |
516 file (if this file does not exist, just create it). | |
517 | |
518 @example | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
519 (global-font-lock-mode t) |
25906 | 520 @end example |
521 | |
522 But the default colors might not be the ones you like. Fortunately, | |
523 there is a very easy way to change them. Just select the menu | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
524 @samp{Help->Customize->Specific Face...} and press @key{RET}. This |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
525 will display a buffer will all the ``faces'' (the colors) that Emacs knows |
25906 | 526 about. You can change any of them. |
527 | |
528 | |
529 @c ----------------------------------------------------------------------- | |
530 @node Moving Through Ada Code, Identifier completion, Syntax highlighting, Top | |
531 @chapter Moving Through Ada Code | |
532 @c ----------------------------------------------------------------------- | |
533 | |
534 There are several easy to use commands to stroll through Ada code. All | |
535 these functions are available through the Ada menu, and you can also use | |
536 the following key bindings or the command names: | |
537 | |
538 @table @kbd | |
40705 | 539 @item C-M-e |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
540 @findex ada-next-procedure |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
541 Move to the next function/procedure/task, which ever comes next |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
542 (@code{ada-next-procedure}). |
40705 | 543 @item C-M-a |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
544 @findex ada-previous-procedure |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
545 Move to previous function/procedure/task |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
546 (@code{ada-previous-procedure}). |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
547 @item M-x ada-next-package |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
548 @findex ada-next-package |
25906 | 549 Move to next package. |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
550 @item M-x ada-prev-package |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
551 @findex ada-prev-package |
25906 | 552 Move to previous package. |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
553 @item C-c C-a |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
554 @findex ada-move-to-start |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
555 Move to matching start of @code{end} (@code{ada-move-to-start}). If |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
556 point is at the end of a subprogram, this command jumps to the |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
557 corresponding @code{begin} if the user option |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
558 @code{ada-move-to-declaration} is @code{nil} (default), it jumps to |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
559 the subprogram declaration otherwise. |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
560 @item C-c C-e |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
561 @findex ada-move-to-end |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
562 Move point to end of current block (@code{ada-move-to-end}). |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
563 @item C-c o |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
564 Switch between corresponding spec and body file |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
565 (@code{ff-find-other-file}). If the cursor is on a subprogram, switch |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
566 between declaration and body. |
25906 | 567 @item C-c c-d |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
568 @findex ada-goto-declaration |
25906 | 569 Move from any reference to its declaration and switch between |
570 declaration and body (for procedures, tasks, private and incomplete | |
571 types). | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
572 @item C-c C-r |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
573 @findex ada-find-references |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
574 runs the @file{gnatfind} command to search for all references to the |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
575 entity pointed by the cursor (@code{ada-find-references}). Use |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
576 @kbd{C-x `} (@code{next-error}) to visit each reference (as for |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
577 compilation errors). |
25906 | 578 @end table |
579 | |
580 These functions use the information in the output of the Gnat Ada | |
581 compiler. However, if your application was compiled with the | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
582 @samp{-gnatx} switch, these functions will not work, since no extra |
25906 | 583 information is generated by GNAT. See GNAT documentation for further |
584 information. | |
585 | |
586 Emacs will try to run Gnat for you whenever the cross-reference | |
587 informations are older than your source file (provided the | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
588 @code{ada-xref-create-ali} variable is non-@code{nil}). Gnat then produces a |
25906 | 589 file with the same name as the current Ada file but with the extension |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
590 changed to @file{.ali}. This files are normally used by the binder, but |
25906 | 591 they will also contain additional cross-referencing information. |
592 | |
593 @c ----------------------------------------------------------------------- | |
594 @node Identifier completion, Index Menu of Subprograms, Moving Through Ada Code, Top | |
595 @chapter Identifier completion | |
596 @c ----------------------------------------------------------------------- | |
597 | |
598 @c ----------------------------------------------------------------------- | |
599 @section Overview | |
600 @c ----------------------------------------------------------------------- | |
601 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
602 Emacs and Ada mode provide two general ways for the completion of |
25906 | 603 identifiers. This is an easy way to type faster: you just have to type |
73494
c2808e06f0d0
* ada-mode.texi (Project files, Identifier completion)
Chong Yidong <cyd@stupidchicken.com>
parents:
69681
diff
changeset
|
604 the first few letters of an identifier, and then loop through all the |
25906 | 605 possible completions. |
606 | |
607 The first method is general for Emacs. It will work both with Ada | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
608 buffers, but also in C buffers, Java buffers, @enddots{} The idea is to parse |
25906 | 609 all the opened buffers for possible completions. |
610 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
611 For instance, if the words @samp{my_identifier}, @samp{my_subprogram} |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
612 are the only words starting with @samp{my} in any of the opened files, |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
613 then you will have this scenario: |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
614 |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
615 @quotation |
25906 | 616 You type: my@key{M-/} |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
617 Emacs inserts: @samp{my_identifier} |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
618 If you press @key{M-/} once again, Emacs replaces @samp{my_identifier} with |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
619 @samp{my_subprogram}. |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
620 Pressing @key{M-/} once more will bring you back to @samp{my_identifier}. |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
621 @end quotation |
25906 | 622 |
623 This is a very fast way to do completion, and the casing of words will | |
624 also be respected. | |
625 | |
73494
c2808e06f0d0
* ada-mode.texi (Project files, Identifier completion)
Chong Yidong <cyd@stupidchicken.com>
parents:
69681
diff
changeset
|
626 The second method is specific to Ada buffers, and even to users of the |
38881
ef5cc490984d
Fix a few minor markup errors.
Eli Zaretskii <eliz@gnu.org>
parents:
38864
diff
changeset
|
627 Gnat compiler. Emacs will search the cross-information found in the |
ef5cc490984d
Fix a few minor markup errors.
Eli Zaretskii <eliz@gnu.org>
parents:
38864
diff
changeset
|
628 @samp{.ali} files generated by Gnat for possible completions. |
25906 | 629 |
630 The main advantage is that this completion is more accurate: only | |
631 existing identifier will be suggested, you don't need to have a file | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
632 opened that already contains this identifiers, @enddots{} |
25906 | 633 |
634 On the other hand, this completion is a little bit slower and requires | |
635 that you have compiled your file at least once since you created that | |
636 identifier. | |
637 | |
638 @c ----------------------------------------------------------------------- | |
639 @section Summary of commands | |
640 @c ----------------------------------------------------------------------- | |
641 | |
642 @table @kbd | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
643 @item C-@key{TAB} |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
644 @findex ada-complete-identifier |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
645 Complete accurately current identifier using information in @samp{.ali} file |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
646 (@code{ada-complete-identifier}). |
25906 | 647 @item M-/ |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
648 Complete identifier using buffer information (not Ada-specific). |
25906 | 649 @end table |
650 | |
651 @c ----------------------------------------------------------------------- | |
652 @node Index Menu of Subprograms, File Browser, Identifier completion, Top | |
653 @chapter Index Menu of Subprograms | |
654 @c ----------------------------------------------------------------------- | |
655 | |
656 You can display a choice menu with all procedure/function/task | |
657 declarations in the file and choose an item by mouse click to get to its | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
658 declaration. This function is accessible through the @samp{Ada} menu when |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
659 editing a Ada file, or simply through the following key binding: |
25906 | 660 |
661 @table @kbd | |
36509
45500c80145f
Fix case convention for mouse click.
Richard M. Stallman <rms@gnu.org>
parents:
30009
diff
changeset
|
662 @item C-S-Mouse-3 |
25906 | 663 display index menu |
664 @end table | |
665 | |
666 @c ----------------------------------------------------------------------- | |
667 @node File Browser, Automatic Smart Indentation, Index Menu of Subprograms, Top | |
668 @chapter File Browser | |
669 @c ----------------------------------------------------------------------- | |
670 | |
671 Emacs provides a special mode, called @code{speedbar}. When this mode is | |
672 activated, a new frame is displayed, with a file browser. The files from | |
673 the current directory are displayed, and you can click on them as you | |
674 would with any file browser. The following commands are then available. | |
675 | |
676 You can click on a directory name or file name to open it. The editor | |
677 will automatically select the best possible mode for this file, | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
678 including of course Ada mode for files written in Ada. |
25906 | 679 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
680 If you click on the @samp{[+]} symbol near a file name, all the symbols (types, |
25906 | 681 variables and subprograms) defined in that file will be displayed, and |
682 you can directly click on them to open the right file at the right | |
683 place. | |
684 | |
685 You can activate this mode by typing @key{M-x speedbar} in the editor. | |
46918
82d113655734
Minor spelling and grammar corrections.
Paul Eggert <eggert@twinsun.com>
parents:
43961
diff
changeset
|
686 This will open a new frame. A better way might be to associate the |
25906 | 687 following key binding |
688 | |
689 @example | |
690 (global-set-key [f7] 'speedbar-get-focus) | |
691 @end example | |
692 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
693 Every time you press @key{F7}, the mouse will automatically move to the |
25906 | 694 speedbar frame (which will be created if it does not exist). |
695 | |
696 @c ----------------------------------------------------------------------- | |
697 @node Automatic Smart Indentation, Formatting Parameter Lists, File Browser, Top | |
698 @chapter Automatic Smart Indentation | |
699 @c ----------------------------------------------------------------------- | |
700 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
701 Ada mode comes with a full set of rules for automatic indentation. |
25906 | 702 You can of course configure the indentation as you want, by setting the |
703 value of a few variables. | |
704 | |
705 As always, the preferred way to modify variables is to use the | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
706 @samp{Ada->Customize} menu (don't forget to save your changes!). This |
25906 | 707 will also show you some example of code where this variable is used, and |
708 hopefully make things clearer. | |
709 | |
710 The relevant variables are the following: | |
711 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
712 @table @asis |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
713 @item @code{ada-broken-indent} (default value: 2) |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
714 Number of columns to indent the continuation of a broken line. |
25906 | 715 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
716 @item @code{ada-indent} (default value: 3) |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
717 Width of the default indentation. |
25906 | 718 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
719 @item @code{ada-indent-record-rel-type} (default value: 3) |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
720 Indentation for @code{record} relative to @code{type} or @code{use}. |
25906 | 721 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
722 @item @code{ada-indent-return} (default value: 0) |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
723 Indentation for @code{return} relative to @code{function} (if |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
724 @code{ada-indent-return} is greater than 0), or the open parenthesis |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
725 (if @code{ada-indent-return} is negative or null). Note that in the second |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
726 case, when there is no open parenthesis, the indentation is done |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
727 relative to @code{function} with the value of @code{ada-broken-indent}. |
25906 | 728 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
729 @item @code{ada-label-indent} (default value: -4) |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
730 Number of columns to indent a label. |
25906 | 731 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
732 @item @code{ada-stmt-end-indent} (default value: 0) |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
733 Number of columns to indent a statement @code{end} keyword on a separate line. |
25906 | 734 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
735 @item @code{ada-when-indent} (default value: 3) |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
736 Indentation for @code{when} relative to @code{exception} or @code{case}. |
25906 | 737 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
738 @item @code{ada-indent-is-separate} (default value: t) |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
739 Non-@code{nil} means indent @code{is separate} or @code{is abstract} if on a single line. |
25906 | 740 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
741 @item @code{ada-indent-to-open-paren} (default value: t) |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
742 Non-@code{nil} means indent according to the innermost open parenthesis. |
25906 | 743 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
744 @item @code{ada-indent-after-return} (default value: t) |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
745 Non-@code{nil} means that the current line will also be re-indented before |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
746 inserting a newline, when you press @key{RET}. |
25906 | 747 @end table |
748 | |
749 Most of the time, the indentation will be automatic, i.e when you will | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
750 press @key{RET}, the cursor will move to the correct column on the |
25906 | 751 next line. |
752 | |
753 However, you might want or need sometimes to re-indent the current line | |
754 or a set of lines. For this, you can simply go to that line, or select | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
755 the lines, and then press @key{TAB}. This will automatically re-indent |
25906 | 756 the lines. |
757 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
758 Another mode of indentation exists that helps you to set up your |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
759 indentation scheme. If you press @kbd{C-c @key{TAB}}, Ada mode will do |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
760 the following: |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
761 |
25906 | 762 @itemize @bullet |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
763 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
764 Reindent the current line, as @key{TAB} would do. |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
765 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
766 Temporarily move the cursor to a reference line, i.e., the line that |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
767 was used to calculate the current indentation. |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
768 @item |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
769 Display at the bottom of the window the name of the variable that |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
770 provided the offset for the indentation. |
25906 | 771 @end itemize |
772 | |
773 The exact indentation of the current line is the same as the one for the | |
774 reference line, plus an offset given by the variable. | |
775 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
776 Once you know the name of the variable, you can either modify it |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
777 through the usual @samp{Ada->Customize} menu, or by typing @kbd{M-x |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
778 customize-variable @key{RET}} in the Emacs window, and then give the |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
779 name of the variable. |
25906 | 780 |
781 @table @kbd | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
782 @item @key{TAB} |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
783 Indent the current line or the current region. |
40705 | 784 @item C-M-\ |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
785 Indent lines in the current selected block. |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
786 @item C-c @key{TAB} |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
787 Indent the current line and prints the name of the variable used for |
25906 | 788 indentation. |
789 @end table | |
790 | |
791 | |
792 | |
793 @c ----------------------------------------------------------------------- | |
794 @node Formatting Parameter Lists, Automatic Casing, Automatic Smart Indentation, Top | |
795 @chapter Formatting Parameter Lists | |
796 @c ----------------------------------------------------------------------- | |
797 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
798 To help you correctly align fields in a subprogram parameter list, |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
799 Emacs provides one function that will do most of the work for you. |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
800 This function will align the declarations on the colon (@samp{:}) |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
801 separating argument names and argument types, plus align the |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
802 @code{in}, @code{out} and @code{in out} keywords if required. |
25906 | 803 |
804 @table @kbd | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
805 @item C-c C-f |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
806 @findex ada-format-paramlist |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
807 Format the parameter list (@code{ada-format-paramlist}). |
25906 | 808 @end table |
809 | |
810 @c ----------------------------------------------------------------------- | |
811 @node Automatic Casing, Statement Templates, Formatting Parameter Lists, Top | |
812 @chapter Automatic Casing | |
813 @c ----------------------------------------------------------------------- | |
814 | |
815 Casing of identifiers, attributes and keywords is automatically | |
816 performed while typing when the variable @code{ada-auto-case} is set. | |
817 Every time you press a word separator, the previous word is | |
818 automatically cased. | |
819 | |
820 You can customize the automatic casing differently for keywords, | |
821 attributes and identifiers. The relevant variables are the following: | |
822 @code{ada-case-keyword}, @code{ada-case-attribute} and | |
823 @code{ada-case-identifier}. | |
824 | |
825 All these variables can have one of the following values: | |
826 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
827 @table @code |
25906 | 828 @item downcase-word |
829 The previous word will simply be in all lower cases. For instance | |
830 @code{My_vARIable} is converted to @code{my_variable}. | |
831 | |
832 @item upcase-word | |
833 The previous word will be fully converted to upper cases. For instance | |
834 @code{My_vARIable} is converted to @code{MY_VARIABLE}. | |
835 | |
836 @item ada-capitalize-word | |
837 All letters, except the first one of the word and every letter after the | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
838 @samp{_} character are lower cased. Other letters are upper cased. For |
25906 | 839 instance @code{My_vARIable} is converted to @code{My_Variable}. |
840 | |
841 @item ada-loose-case-word | |
73494
c2808e06f0d0
* ada-mode.texi (Project files, Identifier completion)
Chong Yidong <cyd@stupidchicken.com>
parents:
69681
diff
changeset
|
842 No letters are modified in the previous word, except the ones after the |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
843 @samp{_} character that are upper cased. For instance @code{My_vARIable} is |
25906 | 844 converted to @code{My_VARIable}. |
845 @end table | |
846 | |
847 These functions, although they will work in most cases, will not be | |
848 accurate sometimes. The Ada mode allows you to define some exceptions, | |
849 that will always be cased the same way. | |
850 | |
851 The idea is to create a dictionary of exceptions, and store it in a | |
852 file. This file should contain one identifier per line, with the casing | |
853 you want to force. The default name for this file is | |
854 @file{~/.emacs_case_exceptions}. You can of course change this name, | |
855 through the variable @code{ada-case-exception-file}. | |
856 | |
857 Note that each line in this file must start with the key word whose | |
858 casing you want to specify. The rest of the line can be used for | |
859 comments (explaining for instance what an abbreviation means, as | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
860 recommended in the Ada 95 Quality and Style, paragraph 3.1.4). Thus, a |
25906 | 861 good example for this file could be: |
862 | |
863 @example | |
864 DOD Department of Defense | |
865 Text_IO | |
866 GNAT The GNAT compiler from Ada Core Technologies | |
867 @end example | |
868 | |
869 When working on project involving multiple programmers, we recommend | |
870 that every member of the team sets this variable to the same value, | |
871 which should point to a system-wide file that each of them can | |
872 write. That way, you will ensure that the casing is consistent | |
873 throughout your application(s). | |
874 | |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
875 @findex ada-create-case-exception |
25906 | 876 There are two ways to add new items to this file: you can simply edit it |
877 as you would edit any text file, and add or suppress entries in this | |
878 file. Remember that you should put one entity per line. The other, | |
879 easier way, is to position the cursor over the word you want to add, in | |
880 an Ada buffer. This word should have the casing you want. Then simply | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
881 select the menu @samp{Ada->Edit->Create Case Exception}, or the key |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
882 @kbd{C-c C-y} (@code{ada-create-case-exception}). The word will |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
883 automatically be added to the current list of exceptions and to the file. |
25906 | 884 |
885 It is sometimes useful to have multiple exception files around (for | |
886 instance, one could be the standard Ada acronyms, the second some | |
887 company specific exceptions, and the last one some project specific | |
888 exceptions). If you set up the variable @code{ada-case-exception-file} | |
889 as a list of files, each of them will be parsed and used in your emacs | |
890 session. | |
891 | |
892 However, when you save a new exception through the menu, as described | |
893 above, the new exception will be added to the first file in the list | |
894 only. You can not automatically add an exception to one of the other | |
895 files, although you can of course edit the files by hand at any time. | |
896 | |
73494
c2808e06f0d0
* ada-mode.texi (Project files, Identifier completion)
Chong Yidong <cyd@stupidchicken.com>
parents:
69681
diff
changeset
|
897 Automatic casing can be performed on part of the buffer, or on the |
c2808e06f0d0
* ada-mode.texi (Project files, Identifier completion)
Chong Yidong <cyd@stupidchicken.com>
parents:
69681
diff
changeset
|
898 whole buffer, using: |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
899 |
25906 | 900 @table @kbd |
901 @item C-c C-b | |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
902 @findex ada-adjust-case-buffer |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
903 Adjust case in the whole buffer (@code{ada-adjust-case-buffer}). |
25906 | 904 @item C-c C-y |
905 Create a new entry in the exception dictionary, with the word under | |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
906 the cursor (@code{ada-create-case-exception}) |
25906 | 907 @item C-c C-t |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
908 @findex ada-case-read-exceptions |
25906 | 909 Rereads the exception dictionary from the file |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
910 @code{ada-case-exception-file} (@code{ada-case-read-exceptions}). |
25906 | 911 @end table |
912 | |
913 @c ----------------------------------------------------------------------- | |
914 @node Statement Templates, Comment Handling, Automatic Casing, Top | |
915 @chapter Statement Templates | |
916 @c ----------------------------------------------------------------------- | |
917 | |
918 NOTE: This features are not available on VMS for Emacs 19.28. The | |
919 functions used here do not exist on Emacs 19.28. | |
920 | |
921 Templates exist for most Ada statements. They can be inserted in the | |
922 buffer using the following commands: | |
923 | |
924 @table @kbd | |
925 @item C-c t b | |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
926 @findex ada-exception-block |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
927 exception Block (@code{ada-exception-block}). |
25906 | 928 @item C-c t c |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
929 @findex ada-case |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
930 case (@code{ada-case}). |
25906 | 931 @item C-c t d |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
932 @findex ada-declare-block |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
933 declare Block (@code{ada-declare-block}). |
25906 | 934 @item C-c t e |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
935 @findex ada-else |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
936 else (@code{ada-else}). |
25906 | 937 @item C-c t f |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
938 @findex ada-for-loop |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
939 for Loop (@code{ada-for-loop}). |
25906 | 940 @item C-c t h |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
941 @findex ada-header |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
942 Header (@code{ada-header}). |
25906 | 943 @item C-c t i |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
944 @findex ada-if |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
945 if (@code{ada-if}). |
25906 | 946 @item C-c t k |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
947 @findex ada-package-body |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
948 package Body (@code{ada-package-body}). |
25906 | 949 @item C-c t l |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
950 @findex ada-loop |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
951 loop (@code{ada-loop}). |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
952 @item C-c p |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
953 @findex ada-subprogram-body |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
954 subprogram body (@code{ada-subprogram-body}). |
25906 | 955 @item C-c t t |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
956 @findex ada-task-body |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
957 task Body (@code{ada-task-body}). |
25906 | 958 @item C-c t w |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
959 @findex ada-while |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
960 while Loop (@code{ada-while}). |
25906 | 961 @item C-c t u |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
962 @findex ada-use |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
963 use (@code{ada-use}). |
25906 | 964 @item C-c t x |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
965 @findex ada-exit |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
966 exit (@code{ada-exit}). |
25906 | 967 @item C-c t C-a |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
968 @findex ada-array |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
969 array (@code{ada-array}). |
25906 | 970 @item C-c t C-e |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
971 @findex ada-elsif |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
972 elsif (@code{ada-elsif}). |
25906 | 973 @item C-c t C-f |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
974 @findex ada-function-spec |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
975 function Spec (@code{ada-function-spec}). |
25906 | 976 @item C-c t C-k |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
977 @findex ada-package-spec |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
978 package Spec (@code{ada-package-spec}). |
25906 | 979 @item C-c t C-p |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
980 @findex ada-procedure-spec |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
981 procedure Spec (@code{ada-package-spec}. |
25906 | 982 @item C-c t C-r |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
983 @findex ada-record |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
984 record (@code{ada-record}). |
25906 | 985 @item C-c t C-s |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
986 @findex ada-subtype |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
987 subtype (@code{ada-subtype}). |
25906 | 988 @item C-c t C-t |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
989 @findex ada-task-spec |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
990 task Spec (@code{ada-task-spec}). |
25906 | 991 @item C-c t C-u |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
992 @findex ada-with |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
993 with (@code{ada-with}). |
25906 | 994 @item C-c t C-v |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
995 @findex ada-private |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
996 private (@code{ada-private}). |
25906 | 997 @item C-c t C-w |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
998 @findex ada-when |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
999 when (@code{ada-when}). |
25906 | 1000 @item C-c t C-x |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
1001 @findex ada-exception |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
1002 exception (@code{ada-exception}). |
25906 | 1003 @item C-c t C-y |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
1004 @findex ada-type |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
1005 type (@code{ada-type}). |
25906 | 1006 @end table |
1007 | |
1008 @c ----------------------------------------------------------------------- | |
1009 @node Comment Handling, Compiling Executing, Statement Templates, Top | |
1010 @chapter Comment Handling | |
1011 @c ----------------------------------------------------------------------- | |
1012 | |
1013 By default, comment lines get indented like Ada code. There are a few | |
1014 additional functions to handle comments: | |
1015 | |
1016 | |
1017 @table @kbd | |
1018 @item M-; | |
1019 Start a comment in default column. | |
1020 @item M-j | |
1021 Continue comment on next line. | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1022 @item C-c ; |
25906 | 1023 Comment the selected region (add -- at the beginning of lines). |
1024 @item C-c : | |
1025 Uncomment the selected region | |
1026 @item M-q | |
1027 autofill the current comment. | |
1028 @end table | |
1029 | |
1030 @c ----------------------------------------------------------------------- | |
1031 @node Compiling Executing, Debugging, Comment Handling, Top | |
1032 @chapter Compiling Executing | |
1033 @c ----------------------------------------------------------------------- | |
1034 | |
1035 Ada mode provides a much complete environment for compiling, debugging | |
1036 and running an application within Emacs. | |
1037 | |
1038 All the commands used by Emacs to manipulate your application can be | |
1039 customized in the project file. Some default values are provided, but | |
1040 these will likely not be good enough for a big or even medium-sized | |
1041 project. See the section on the project file for an explanation on how | |
1042 to set up the commands to use. | |
1043 | |
1044 One of the variables you can set in your project file, | |
1045 @code{cross_prefix}, indicates whether you are using a cross-compilation | |
1046 environment, and if yes for which target. The default command used for | |
1047 compilation will add this @code{cross_prefix} in front of the name: | |
1048 @code{gcc} will become @code{cross_prefix}-@code{gcc}, @code{gnatmake} | |
38881
ef5cc490984d
Fix a few minor markup errors.
Eli Zaretskii <eliz@gnu.org>
parents:
38864
diff
changeset
|
1049 will become @code{cross_prefix}-@code{gnatmake}, @enddots{} |
25906 | 1050 |
1051 This will also modify the way your application is run and debugged, | |
1052 although this is not implemented at the moment. | |
1053 | |
1054 Here are the commands for building and using an Ada application | |
1055 | |
1056 @itemize @bullet | |
1057 | |
1058 @item Compiling the current source | |
1059 This command is issued when issuing the @code{compile} command from the | |
1060 Ada menu. It compiles unconditionally the current source using the | |
1061 @code{comp_cmd} variable of the project file. Compilation options can be | |
1062 customized with the variable @code{comp_opt} of the project file. | |
1063 | |
1064 Emacs will display a new buffer that contains the result of the | |
1065 compilation. Each line associated with an error will become active: you | |
1066 can simply click on it with the middle button of the mouse, or move the | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1067 cursor on it and press @key{RET}. Emacs will then display the |
25906 | 1068 relevant source file and put the cursor on the line and column the error |
1069 was found at. | |
1070 | |
1071 You can also simply press the @kbd{C-x `} key and Emacs will jump to the | |
1072 first error. If you press that key again, it will move you to the second | |
1073 error, and so on. | |
1074 | |
1075 Some error messages might also include references to some files. These | |
1076 references are also clickable in the same way. | |
1077 | |
1078 | |
1079 @item (Re)building the whole application | |
1080 This command is issued when you select the @code{build} command from the | |
1081 Ada menu. It compiles all obsolete units of the current application | |
1082 using the @code{make_cmd} variable of the project file. Compilation | |
1083 options can be customized with the variable @code{comp_opt} of the | |
1084 project file, binder options with @code{bind_opt} and linker options | |
1085 with @code{link_opt}. The main unit of the application may be specified | |
1086 with @code{main}. | |
1087 | |
1088 The compilation buffer is also active in the same way it was for the above | |
1089 command. | |
1090 | |
1091 @item Running the application | |
1092 This command is issued when you select the @code{run} command from the | |
1093 Ada menu. It executes the current application in an emacs | |
1094 buffer. Arguments can be passed through before executing. The execution | |
1095 buffer allows for interactive input/output. | |
1096 | |
1097 This command is not yet available in a cross-compilation | |
1098 toolchain. Emacs would first need to log on the target before running | |
1099 the application. This will be implemented in a future release of Gnat. | |
1100 | |
1101 @end itemize | |
1102 | |
1103 @c --------------------------------------------------------------------- | |
1104 @node Debugging, Using non-standard file names, Compiling Executing, Top | |
1105 @chapter Debugging your application | |
1106 @c --------------------------------------------------------------------- | |
1107 | |
1108 You can set up in the project file a command to use to debug your | |
1109 application. Emacs is compatible with a lot of debuggers, and provide an | |
1110 easy interface to them. | |
1111 | |
73494
c2808e06f0d0
* ada-mode.texi (Project files, Identifier completion)
Chong Yidong <cyd@stupidchicken.com>
parents:
69681
diff
changeset
|
1112 This section will focus on the gdb debugger, and two of the graphical |
25906 | 1113 interfaces that exist for it. |
1114 | |
1115 In all cases, the main window in Emacs will be split in two: in the | |
1116 upper buffer, the source code will appear, whereas the debugger | |
1117 input/output window is displayed at the bottom. You can enter the | |
1118 debugger commands as usual in the command window. Every time a new | |
1119 source file is selected by the debugger (for instance as a result of a | |
1120 @code{frame} command), the appropriate source file is displayed in the | |
1121 upper buffer. | |
1122 | |
1123 The source window is interactive: you can click on an identifier with the | |
1124 right mouse button, and print its value in the debugger window. You can | |
1125 also set a breakpoint simply by right-clicking on a line. | |
1126 | |
1127 You can easily use Emacs as the source window when you are using a | |
1128 graphical interface for the debugger. The interesting thing is that, | |
73494
c2808e06f0d0
* ada-mode.texi (Project files, Identifier completion)
Chong Yidong <cyd@stupidchicken.com>
parents:
69681
diff
changeset
|
1129 whereas you still have the graphical nifties, you can also use the |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1130 cross-references features that Ada mode provides to look at the |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1131 definition for the identifiers, @enddots{} |
25906 | 1132 |
1133 Here is how you can set up gdbtk and ddd for use with Emacs (These are | |
1134 the commands you should setup in the project file): | |
1135 | |
1136 @itemize @bullet | |
1137 @item gdbtk | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1138 should be used with the switch @samp{--emacs_gdbtk}. It provides a nice |
25906 | 1139 backtrace window, as well as a tasks window. You can click interactively |
1140 on both of them, and Emacs will display the source file on the correct | |
1141 line. | |
1142 | |
1143 @item ddd (Data Display Debugger) | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1144 should be used with the switches @samp{--tty} and |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1145 @samp{--fullname}. Whenever you print a variable from Emacs, it will |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1146 be displayed graphically in the data window. |
25906 | 1147 |
1148 @end itemize | |
1149 | |
1150 | |
1151 @c --------------------------------------------------------------------- | |
1152 @node Using non-standard file names, Working Remotely, Debugging, Top | |
1153 @chapter Using non-standard file names | |
1154 @c --------------------------------------------------------------------- | |
1155 | |
1156 By default, Emacs is configured to use the GNAT style file names, where | |
1157 file names are the package names, and the extension for spec and bodies | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1158 are respectively @samp{.ads} and @samp{.adb}. |
25906 | 1159 |
1160 If you want to use other types of file names, you will need to modify | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1161 your @file{.emacs} file. |
25906 | 1162 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1163 Adding new possible extensions is easy. Since Ada mode needs to know |
25906 | 1164 how to go from the body to the spec (and back), you always have to |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1165 specify both. A function is provided with Ada mode to add new |
25906 | 1166 extensions. |
1167 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1168 For instance, if your spec and bodies files are called |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1169 @file{@var{unit}_s.ada} and @file{@var{unit}_b.ada}, respectively, you |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1170 need to add the following to your @file{.emacs} file: |
25906 | 1171 |
1172 @example | |
1173 (ada-add-extensions "_s.ada" "_b.ada") | |
1174 @end example | |
1175 | |
73494
c2808e06f0d0
* ada-mode.texi (Project files, Identifier completion)
Chong Yidong <cyd@stupidchicken.com>
parents:
69681
diff
changeset
|
1176 Note that it is possible to redefine the extensions, even if they already |
25906 | 1177 exist, as in: |
1178 | |
1179 @example | |
1180 (ada-add-extensions ".ads" "_b.ada") | |
1181 (ada-add-extensions ".ads" ".body") | |
1182 @end example | |
1183 | |
1184 This simply means that whenever the ada-mode will look for the body for | |
1185 a file whose extension is @file{.ads}, it will take the first available | |
1186 file that ends with either @file{.adb} (standard), @file{_b.ada} or | |
1187 @file{.body}. | |
1188 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1189 If the filename is not the unit name, then things are a little more |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1190 complicated. You then need to rewrite the function |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1191 @code{ada-make-filename-from-adaname} (see the file @file{ada-mode.el} |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1192 for an example). |
25906 | 1193 |
1194 @c --------------------------------------------------------------------- | |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
1195 @node Working Remotely, Index, Using non-standard file names, Top |
25906 | 1196 @chapter Working Remotely |
1197 @c --------------------------------------------------------------------- | |
1198 | |
73494
c2808e06f0d0
* ada-mode.texi (Project files, Identifier completion)
Chong Yidong <cyd@stupidchicken.com>
parents:
69681
diff
changeset
|
1199 When you work on a project that involves a lot of programmers, it is |
25906 | 1200 generally the case that you will edit the files on your own machine, but |
1201 you want to compile, run and debug your application in another buffer. | |
1202 | |
1203 Fortunately, here too Emacs provides a very convenient way to do this. | |
1204 | |
1205 @c --------------------------------------------------------------------- | |
1206 @section Remote editing | |
1207 @c --------------------------------------------------------------------- | |
1208 | |
1209 First of all, the files do not need to be on your machine. Emacs can | |
1210 edit any remote file, by doing transparent FTP sessions between your | |
1211 machine and the remote machine that stores your files. This is a special | |
1212 Emacs mode, called @code{ange-ftp}. To use it, you just have to use a | |
1213 slightly different syntax when you open a file. | |
1214 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1215 For instance, if you want to open the file @file{/work/foo.adb} on the machine |
25906 | 1216 aleph.gnu.org, where you log in as qwe, you would simply do this: |
1217 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1218 @example |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1219 C-x C-f /qwe@@aleph.gnu.org:/work/foo.adb @key{RET} |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1220 @end example |
25906 | 1221 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1222 @noindent |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1223 i.e., use your name, the name of the machine and the name of the file. |
25906 | 1224 |
1225 The first time, Emacs will ask you for a password that it will remember | |
1226 until you close the current Emacs. Even if the ftp session times out, | |
1227 you won't need to reenter your password. | |
1228 | |
1229 Every time you save the file, Emacs will upload it to the remote machine | |
1230 transparently. No file is modified on the local machine. | |
1231 | |
1232 @c --------------------------------------------------------------------- | |
1233 @section Remote compiling | |
1234 @c --------------------------------------------------------------------- | |
1235 | |
1236 If the machine you want to compile on is not the one your Emacs is | |
1237 running on, you can set the variable @code{remote_machine} in the | |
1238 project file for your application. | |
1239 | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1240 This will force Emacs to issue a @command{rsh} command for the compilation, |
25906 | 1241 instead of running it on the local machine. Unfortunately, this won't |
1242 work on Windows workstations, since this protocol is not supported. | |
1243 | |
1244 @example | |
1245 If your @code{remote_machine} is aleph.gnu.org and the standard | |
1246 compilation command is @code{cd /work/ && gnatmake foo}, then Emacs will | |
1247 actually issue the command @code{rsh aleph.gnu.org 'cd /work/ && | |
1248 gnatmake foo'}. | |
1249 @end example | |
1250 | |
1251 The advantage of using the @code{remote_machine} variable is that it is | |
1252 easier to change that machine without having to modify the compilation | |
1253 command. | |
1254 | |
1255 Note that if you need to set up some environment variables before the | |
1256 compilation, you need to insert a call to the appropriate initialization | |
1257 script in the compilation command, for instance: | |
1258 | |
1259 @example | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1260 build_cmd= initialization_script; cd /work/ && gnatmake foo |
25906 | 1261 @end example |
1262 | |
1263 @c --------------------------------------------------------------------- | |
1264 @section Remote running and debugging | |
1265 @c --------------------------------------------------------------------- | |
1266 | |
1267 This feature is not completely implemented yet. | |
1268 | |
1269 However, most of the time, you will be able to run your application | |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1270 remotely simply by replacing it with a @command{rsh} call. |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1271 For instance, if your command was @code{$@{main@}}, you could replace it with |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1272 @code{rsh aleph.gnu.org $@{main@}}. |
25906 | 1273 |
38864
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1274 However, this would not work on vxworks, for instance, where |
c656fc177008
Many corrections in Texinfo usage and English usage.
Richard M. Stallman <rms@gnu.org>
parents:
37403
diff
changeset
|
1275 @command{rsh} is not supported. |
25906 | 1276 |
39367
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
1277 @node Index, , Working Remotely, Top |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
1278 @unnumbered Index |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
1279 |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
1280 @printindex fn |
88b1d99e92ad
Add an Index and index all commands. This is so C-h C-f works.
Eli Zaretskii <eliz@gnu.org>
parents:
38881
diff
changeset
|
1281 |
25906 | 1282 @contents |
1283 @bye | |
52401 | 1284 |
1285 @ignore | |
1286 arch-tag: 68cf0d8a-55cc-4190-a28d-4984fa56ed1e | |
1287 @end ignore |