diff options
| author | Richard M. Stallman | 2001-08-20 01:14:55 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-08-20 01:14:55 +0000 |
| commit | 2e78ad148c515db46fe3ae23835a0028ec8d4a24 (patch) | |
| tree | 6dc22fa7a987ab675d283914a6751802e6b1195d | |
| parent | 9efa277712a43a3a5eeb359dccc6b67f3fcb23ba (diff) | |
| download | emacs-2e78ad148c515db46fe3ae23835a0028ec8d4a24.tar.gz emacs-2e78ad148c515db46fe3ae23835a0028ec8d4a24.zip | |
Many corrections in Texinfo usage and English usage.
| -rw-r--r-- | man/ada-mode.texi | 500 |
1 files changed, 273 insertions, 227 deletions
diff --git a/man/ada-mode.texi b/man/ada-mode.texi index 1ad2158e0bb..13c0ffa004c 100644 --- a/man/ada-mode.texi +++ b/man/ada-mode.texi | |||
| @@ -73,8 +73,8 @@ license to the document, as described in section 6 of the license. | |||
| 73 | 73 | ||
| 74 | @menu | 74 | @menu |
| 75 | * Overview:: | 75 | * Overview:: |
| 76 | * Installation:: Installing the Ada mode on your system | 76 | * Installation:: Installing Ada mode on your system |
| 77 | * Customization:: Setting up the Ada mode to your taste | 77 | * Customization:: Setting up Ada mode to your taste |
| 78 | * Project files:: Describing the organization of your project | 78 | * Project files:: Describing the organization of your project |
| 79 | * Syntax highlighting:: Using specific colors and fonts to highlight | 79 | * Syntax highlighting:: Using specific colors and fonts to highlight |
| 80 | the structure of your files | 80 | the structure of your files |
| @@ -109,39 +109,56 @@ standard Emacs features when programming in Ada. | |||
| 109 | @section General features: | 109 | @section General features: |
| 110 | 110 | ||
| 111 | @itemize @bullet | 111 | @itemize @bullet |
| 112 | @item full Integrated Development Environment : | 112 | @item |
| 113 | full Integrated Development Environment: | ||
| 113 | @itemize @bullet | 114 | @itemize @bullet |
| 114 | @item support of 'project files' for the configuration (directories, | 115 | @item |
| 116 | support of ``project files'' for the configuration (directories, | ||
| 115 | compilation options,...) | 117 | compilation options,...) |
| 116 | @item compiling and stepping through error messages. | 118 | @item |
| 117 | @item running and debugging your applications within Emacs. | 119 | compiling and stepping through error messages. |
| 120 | @item | ||
| 121 | running and debugging your applications within Emacs. | ||
| 118 | @end itemize | 122 | @end itemize |
| 119 | @item easy to use for beginners by pull-down menus, | 123 | @item |
| 120 | @item user configurable by many user-option variables. | 124 | easy to use for beginners by pull-down menus, |
| 125 | @item | ||
| 126 | user configurable by many user-option variables. | ||
| 121 | @end itemize | 127 | @end itemize |
| 122 | 128 | ||
| 123 | @section Ada mode features that help understanding code: | 129 | @section Ada mode features that help understanding code: |
| 124 | 130 | ||
| 125 | @itemize @bullet | 131 | @itemize @bullet |
| 126 | @item functions for easy and quick stepping through Ada code, | 132 | @item |
| 127 | @item getting cross reference information for identifiers (e.g. find the | 133 | functions for easy and quick stepping through Ada code, |
| 134 | @item | ||
| 135 | getting cross reference information for identifiers (e.g. find the | ||
| 128 | defining place by a keystroke), | 136 | defining place by a keystroke), |
| 129 | @item displaying an index menu of types and subprograms and move point to | 137 | @item |
| 138 | displaying an index menu of types and subprograms and move point to | ||
| 130 | the chosen one, | 139 | the chosen one, |
| 131 | @item automatic color highlighting of the various entities in Ada code. | 140 | @item |
| 141 | automatic color highlighting of the various entities in Ada code. | ||
| 132 | @end itemize | 142 | @end itemize |
| 133 | 143 | ||
| 134 | @section Emacs support for writing Ada code: | 144 | @section Emacs support for writing Ada code: |
| 135 | 145 | ||
| 136 | @itemize @bullet | 146 | @itemize @bullet |
| 137 | @item switching between spec and body files with eventually | 147 | @item |
| 148 | switching between spec and body files with eventually | ||
| 138 | auto-generation of body files, | 149 | auto-generation of body files, |
| 139 | @item automatic formating of subprograms parameter lists. | 150 | @item |
| 140 | @item automatic smart indentation according to Ada syntax, | 151 | automatic formating of subprograms parameter lists. |
| 141 | @item automatic completion of identifiers, | 152 | @item |
| 142 | @item automatic casing of identifiers, keywords, and attributes, | 153 | automatic smart indentation according to Ada syntax, |
| 143 | @item insertion of statement templates, | 154 | @item |
| 144 | @item filling comment paragraphs like filling normal text, | 155 | automatic completion of identifiers, |
| 156 | @item | ||
| 157 | automatic casing of identifiers, keywords, and attributes, | ||
| 158 | @item | ||
| 159 | insertion of statement templates, | ||
| 160 | @item | ||
| 161 | filling comment paragraphs like filling normal text, | ||
| 145 | @end itemize | 162 | @end itemize |
| 146 | 163 | ||
| 147 | @c ----------------------------------------------------------------------- | 164 | @c ----------------------------------------------------------------------- |
| @@ -149,21 +166,21 @@ auto-generation of body files, | |||
| 149 | @chapter Installation | 166 | @chapter Installation |
| 150 | @c ----------------------------------------------------------------------- | 167 | @c ----------------------------------------------------------------------- |
| 151 | 168 | ||
| 152 | If you got the Ada mode as a separate distribution, you should have a | 169 | If you got Ada mode as a separate distribution, you should have a |
| 153 | look at the @file{README} file. It explains the basic steps necessary | 170 | look at the @file{README} file. It explains the basic steps necessary |
| 154 | for a good installation of the emacs Ada mode. | 171 | for a good installation of the emacs Ada mode. |
| 155 | 172 | ||
| 156 | Installing the Ada mode is basically just a matter of copying a few | 173 | Installing the Ada mode is basically just a matter of copying a few |
| 157 | files into the Emacs library directories. Every time you open a file | 174 | files into the Emacs library directories. Every time you open a file |
| 158 | with a file extension of @file{.ads} or @file{.adb}, Emacs will | 175 | with a file extension of @file{.ads} or @file{.adb}, Emacs will |
| 159 | automatically load and activate the Ada mode. | 176 | automatically load and activate Ada mode. |
| 160 | 177 | ||
| 161 | See the section @ref{Using non-standard file names}, if your files do | 178 | @xref{Using non-standard file names}, if your files do |
| 162 | not use these extensions and if you want Emacs to automatically start the | 179 | not use these extensions and if you want Emacs to automatically start the |
| 163 | Ada mode every time you edit an Ada file. | 180 | Ada mode every time you edit an Ada file. |
| 164 | 181 | ||
| 165 | See also the Emacs documentation @ref{(emacs)}, for general usage | 182 | See also the Emacs Manual (@pxref{(Top,,,emacs, The Emacs Manual)}), |
| 166 | variables that you might want to set. | 183 | for general usage variables that you might want to set. |
| 167 | 184 | ||
| 168 | @c --------------------------------------------------------------------- | 185 | @c --------------------------------------------------------------------- |
| 169 | @section Required files | 186 | @section Required files |
| @@ -173,16 +190,17 @@ This Ada mode works best with Emacs 20.3 or higher (the easy editing | |||
| 173 | features for the project files won't work with any older version), but | 190 | features for the project files won't work with any older version), but |
| 174 | most of the commands should work with older versions too. Please try to | 191 | most of the commands should work with older versions too. Please try to |
| 175 | install the most recent version of Emacs on your system before | 192 | install the most recent version of Emacs on your system before |
| 176 | installing the Ada mode. | 193 | installing Ada mode. |
| 177 | 194 | ||
| 178 | Although part of the Ada mode is compiler independent, the most advanced | 195 | Although part of Ada mode is compiler-independent, the most advanced |
| 179 | features are specific to the Gnat compiler @url{http://www.gnat.com}. | 196 | features are specific to the Gnat compiler @url{http://www.gnat.com}. |
| 180 | 197 | ||
| 181 | The following files are provided with the Ada mode distribution: | 198 | The following files are provided with the Ada mode distribution: |
| 182 | 199 | ||
| 183 | @itemize @bullet | 200 | @itemize @bullet |
| 184 | 201 | ||
| 185 | @item @file{ada-mode.el}: The main file for the Ada mode. | 202 | @item |
| 203 | @file{ada-mode.el}: The main file for Ada mode. | ||
| 186 | This is the only file which does not require Gnat. It contains the | 204 | This is the only file which does not require Gnat. It contains the |
| 187 | functions for indentation, formatting of parameter lists, stepping | 205 | functions for indentation, formatting of parameter lists, stepping |
| 188 | through code, comment handling and automatic casing. Emacs versions | 206 | through code, comment handling and automatic casing. Emacs versions |
| @@ -190,25 +208,28 @@ through code, comment handling and automatic casing. Emacs versions | |||
| 190 | version of this file and should be replaced. Loading @file{ada-mode.el} | 208 | version of this file and should be replaced. Loading @file{ada-mode.el} |
| 191 | from the current distribution supersedes the standard installation. | 209 | from the current distribution supersedes the standard installation. |
| 192 | 210 | ||
| 193 | @item @file{ada-stmt.el}: Contains the statement templates feature. | 211 | @item |
| 212 | @file{ada-stmt.el}: Contains the statement templates feature. | ||
| 194 | 213 | ||
| 195 | @item @file{ada-xref.el}: This file provides the main support for Gnat. | 214 | @item |
| 215 | @file{ada-xref.el}: This file provides the main support for Gnat. | ||
| 196 | This is where the functions for cross-references, completion of | 216 | This is where the functions for cross-references, completion of |
| 197 | identifiers, support for project files and compilation of your | 217 | identifiers, support for project files and compilation of your |
| 198 | application are defined. | 218 | application are defined. |
| 199 | 219 | ||
| 200 | @item @file{ada-prj.el}: The functions to use for easy-edition of the | 220 | @item |
| 201 | project files. This file is the only one which really requires Emacs at | 221 | @file{ada-prj.el}: The functions to use for easy-edition of the |
| 202 | least 20.2. It uses the new widget features from Emacs. | 222 | project files. This file is the only one which really requires Emacs |
| 223 | at least 20.2. It uses the new widget features from Emacs. | ||
| 203 | 224 | ||
| 204 | @end itemize | 225 | @end itemize |
| 205 | 226 | ||
| 206 | @c -------------------------------------------------------------------- | 227 | @c -------------------------------------------------------------------- |
| 207 | @node Customization, Project files, Installation, Top | 228 | @node Customization, Project files, Installation, Top |
| 208 | @chapter Customizing the Ada mode | 229 | @chapter Customizing Ada mode |
| 209 | @c --------------------------------------------------------------------- | 230 | @c --------------------------------------------------------------------- |
| 210 | 231 | ||
| 211 | The ada-mode is fully customizable. Everything, from the file names to | 232 | Ada mode is fully customizable. Everything, from the file names to |
| 212 | the automatic indentation and the automatic casing can be adapted to | 233 | the automatic indentation and the automatic casing can be adapted to |
| 213 | your own needs. | 234 | your own needs. |
| 214 | 235 | ||
| @@ -216,15 +237,15 @@ There are two different kinds of variables that control this | |||
| 216 | customization, both are easy to modify. | 237 | customization, both are easy to modify. |
| 217 | 238 | ||
| 218 | The first set of variables are standard Emacs variables. Of course, some | 239 | The first set of variables are standard Emacs variables. Of course, some |
| 219 | are defined only for the Ada mode, whereas others have a more general | 240 | are defined only for Ada mode, whereas others have a more general |
| 220 | meaning in Emacs. Please see the Emacs documentation for more | 241 | meaning in Emacs. Please see the Emacs documentation for more |
| 221 | information on the latest. In this documentation, we will detail all the | 242 | information on the latest. In this documentation, we will detail all the |
| 222 | variables that are specific to the Ada mode, and a few others. The names | 243 | variables that are specific to Ada mode, and a few others. The names |
| 223 | will be given, as in @code{ada-case-identifier}. | 244 | will be given, as in @code{ada-case-identifier}. |
| 224 | 245 | ||
| 225 | Emacs provides an easy way to modify them, through a special mode called | 246 | Emacs provides an easy way to modify them, through a special mode called |
| 226 | customization. To access this mode, select the menu | 247 | customization. To access this mode, select the menu |
| 227 | @kbd{Ada->Customize}. This will open a new buffer with some fields that | 248 | @samp{Ada->Customize}. This will open a new buffer with some fields that |
| 228 | you can edit. For instance, you will get something like: | 249 | you can edit. For instance, you will get something like: |
| 229 | @example | 250 | @example |
| 230 | Put below the compiler switches. | 251 | Put below the compiler switches. |
| @@ -241,8 +262,8 @@ with the middle mouse button). This will save the values in your | |||
| 241 | same values. | 262 | same values. |
| 242 | 263 | ||
| 243 | To modify a specific variable, you can directly call the function | 264 | To modify a specific variable, you can directly call the function |
| 244 | @code{customize-variable} from Emacs (just type @key{M-x | 265 | @code{customize-variable} from Emacs (just type @kbd{M-x |
| 245 | customize-variable RET} and then type the variable name. | 266 | customize-variable @key{RET} @var{variable-name} @key{RET}}). |
| 246 | 267 | ||
| 247 | Some users might prefer to modify the variables directly in their | 268 | Some users might prefer to modify the variables directly in their |
| 248 | configuration file, @file{.emacs}. This file is coded in Emacs lisp, and | 269 | configuration file, @file{.emacs}. This file is coded in Emacs lisp, and |
| @@ -270,7 +291,7 @@ Ada programmers. That is to say, editing, compiling, executing and | |||
| 270 | debugging can be performed within Emacs in a convenient and natural way. | 291 | debugging can be performed within Emacs in a convenient and natural way. |
| 271 | 292 | ||
| 272 | To take full advantage of this features, it is possible to create a file | 293 | To take full advantage of this features, it is possible to create a file |
| 273 | in the main directory of your application, with a '.adp' extension. | 294 | in the main directory of your application, with a @samp{.adp} extension. |
| 274 | This file contain all needed information dealing with the way your | 295 | This file contain all needed information dealing with the way your |
| 275 | application is organized between directories, the commands to compile, | 296 | application is organized between directories, the commands to compile, |
| 276 | run and debug it etc. Creating this file is not mandatory and convenient | 297 | run and debug it etc. Creating this file is not mandatory and convenient |
| @@ -283,9 +304,9 @@ menu. It is also possible to edit the project file as a regular text | |||
| 283 | file. | 304 | file. |
| 284 | 305 | ||
| 285 | Once in the buffer for editing the project file, you can save your | 306 | Once in the buffer for editing the project file, you can save your |
| 286 | modification using the '[OK]' button at the bottom of the buffer, or | 307 | modification using the @samp{[OK]} button at the bottom of the buffer, or |
| 287 | simply use the usual @kbd{C-x C-s} binding. To cancel your | 308 | simply use the usual @kbd{C-x C-s} binding. To cancel your |
| 288 | modifications, simply kill the buffer or click on the '[CANCEL]' button | 309 | modifications, simply kill the buffer or click on the @samp{[CANCEL]} button |
| 289 | at the button. | 310 | at the button. |
| 290 | 311 | ||
| 291 | Each buffer using Ada mode will be associated with one project file when | 312 | Each buffer using Ada mode will be associated with one project file when |
| @@ -297,20 +318,25 @@ described in the next section, but you can force the project file you | |||
| 297 | want to use by setting one or two variables in your @file{.emacs} file. | 318 | want to use by setting one or two variables in your @file{.emacs} file. |
| 298 | 319 | ||
| 299 | @itemize @bullet | 320 | @itemize @bullet |
| 300 | @item To set up a default project file to use for any directory, anywhere | 321 | @item |
| 322 | To set up a default project file to use for any directory, anywhere | ||
| 301 | on your system, set the variable @code{ada-prj-default-project-file} to | 323 | on your system, set the variable @code{ada-prj-default-project-file} to |
| 302 | the name of that file. | 324 | the name of that file. |
| 325 | |||
| 303 | @example | 326 | @example |
| 304 | (set 'ada-prj-default-project-file "/dir1/dir2/file") | 327 | (set 'ada-prj-default-project-file "/dir1/dir2/file") |
| 305 | @end example | 328 | @end example |
| 306 | 329 | ||
| 307 | @item For a finer controlled, you can set a per-directory project file. | 330 | @item |
| 331 | For finer control, you can set a per-directory project file. | ||
| 308 | This is done through the variable @code{ada-xref-default-prj-file}. | 332 | This is done through the variable @code{ada-xref-default-prj-file}. |
| 333 | |||
| 309 | @example | 334 | @example |
| 310 | (set 'ada-xref-default-prj-file | 335 | (set 'ada-xref-default-prj-file |
| 311 | '(("/dir1/dir2" . "/dir3/file1") | 336 | '(("/dir1/dir2" . "/dir3/file1") |
| 312 | ("/dir4/dir5" . "/dir6/file2"))) | 337 | ("/dir4/dir5" . "/dir6/file2"))) |
| 313 | @end example | 338 | @end example |
| 339 | |||
| 314 | Note: This has a higher priority than the first variable, so the first | 340 | Note: This has a higher priority than the first variable, so the first |
| 315 | choice is to use this variable settings, and otherwise | 341 | choice is to use this variable settings, and otherwise |
| 316 | @code{ada-prj-default-project-file}. | 342 | @code{ada-prj-default-project-file}. |
| @@ -318,15 +344,15 @@ choice is to use this variable settings, and otherwise | |||
| 318 | 344 | ||
| 319 | 345 | ||
| 320 | @table @kbd | 346 | @table @kbd |
| 321 | @item C-c u ada-customize menu: Ada->Project->New/Edit | 347 | @item C-c u |
| 322 | Create or edit the project file for the current buffer. | 348 | Create or edit the project file for the current buffer (@code{ada-customize}). |
| 323 | @item C-c c ada-change-prj | 349 | @item C-c c |
| 324 | Change the project file associated with the current Ada buffer. | 350 | Change the project file associated with the current Ada buffer (@code{ada-change-prj}). |
| 325 | @item C-c d | 351 | @item C-c d |
| 326 | Change the default project file for the current directory. Every new | 352 | Change the default project file for the current directory. Every new |
| 327 | file opened from this directory will be associated with that file by | 353 | file opened from this directory will be associated with that file by |
| 328 | default. | 354 | default. |
| 329 | @item ada-set-default-project-file menu: Ada->Project->Set Default | 355 | @item ada-set-default-project-file |
| 330 | Set the default project file to use for *any* Ada file opened anywhere | 356 | Set the default project file to use for *any* Ada file opened anywhere |
| 331 | on your system. This sets this file only for the current Emacs session. | 357 | on your system. This sets this file only for the current Emacs session. |
| 332 | @end table | 358 | @end table |
| @@ -346,59 +372,59 @@ will be substituted. | |||
| 346 | 372 | ||
| 347 | Here is the list of variables: | 373 | Here is the list of variables: |
| 348 | 374 | ||
| 349 | @table @code | 375 | @table @asis |
| 350 | @item src_dir [default: "./"] | 376 | @item @code{src_dir} [default: @code{"./"}] |
| 351 | This is a list of directories where the Ada mode will look for source | 377 | This is a list of directories where Ada mode will look for source |
| 352 | files. These directories are used mainly in two cases, both as a switch | 378 | files. These directories are used mainly in two cases, both as a switch |
| 353 | for the compiler and for the cross-references. | 379 | for the compiler and for the cross-references. |
| 354 | 380 | ||
| 355 | @item obj_dir [default: "./"] | 381 | @item @code{obj_dir} [default: @code{"./"}] |
| 356 | This is a list of directories where to look for object and library | 382 | This is a list of directories where to look for object and library |
| 357 | files. The library files are the .ali files generated by Gnat and that | 383 | files. The library files are the @samp{.ali} files generated by Gnat |
| 358 | contain cross-reference informations. | 384 | and that contain cross-reference informations. |
| 359 | 385 | ||
| 360 | @item comp_opt [default: ""] | 386 | @item @code{comp_opt} [default: @code{""}] |
| 361 | Creates a variable which can be referred to subsequently by using the | 387 | Creates a variable which can be referred to subsequently by using the |
| 362 | @code{$@{comp_opt@}} notation. This is intended to store the default | 388 | @code{$@{comp_opt@}} notation. This is intended to store the default |
| 363 | switches given to `gnatmake' and `gcc'. | 389 | switches given to @command{gnatmake} and @command{gcc}. |
| 364 | 390 | ||
| 365 | @item bind_opt=SWITCHES [default: ""] | 391 | @item @code{bind_opt=@var{switches}} [default: @code{""}] |
| 366 | Creates a variable which can be referred to subsequently by using the | 392 | Creates a variable which can be referred to subsequently by using the |
| 367 | @code{$@{bind_opt@}} notation. This is intended to store the default | 393 | @code{$@{bind_opt@}} notation. This is intended to store the default |
| 368 | switches given to `gnatbind'. | 394 | switches given to @command{gnatbind}. |
| 369 | 395 | ||
| 370 | @item link_opt=SWITCHES [default: ""] | 396 | @item @code{link_opt=@var{switches}} [default: @code{""}] |
| 371 | Creates a variable which can be referred to subsequently by using the | 397 | Creates a variable which can be referred to subsequently by using the |
| 372 | @code{$@{link_opt@}} notation. This is intended to store the default | 398 | @code{$@{link_opt@}} notation. This is intended to store the default |
| 373 | switches given to `gnatlink'. | 399 | switches given to @command{gnatlink}. |
| 374 | 400 | ||
| 375 | @item main=EXECUTABLE [default: ""] | 401 | @item @code{main=@var{executable}} [default: @code{""}] |
| 376 | Specifies the name of the executable for the application. This variable | 402 | Specifies the name of the executable for the application. This variable |
| 377 | can be referred to in the following lines by using the @code{$@{main@}} | 403 | can be referred to in the following lines by using the @code{$@{main@}} |
| 378 | notation. | 404 | notation. |
| 379 | 405 | ||
| 380 | @item cross_prefix=PREFIX [default: ""] | 406 | @item @code{cross_prefix=@var{prefix}} [default: @code{""}] |
| 381 | This variable should be set if you are working in a cross-compilation | 407 | This variable should be set if you are working in a cross-compilation |
| 382 | environment. This is the prefix used in front of the gnatmake commands. | 408 | environment. This is the prefix used in front of the gnatmake commands. |
| 383 | 409 | ||
| 384 | @item remote_machine=MACHINE [default: ""] | 410 | @item @code{remote_machine=@var{machine}} [default: @code{""}] |
| 385 | This is the name of the machine to log into before issuing the | 411 | This is the name of the machine to log into before issuing the |
| 386 | compilation command. If this variable is empty, the command will be run | 412 | compilation command. If this variable is empty, the command will be |
| 387 | on the local machine. This will not work on Windows NT machines, since | 413 | run on the local machine. This will not work on Windows NT machines, |
| 388 | the Ada mode will simply precede the compilation command with a 'rsh' | 414 | since Ada mode will simply precede the compilation command with a |
| 389 | command, unknown on Windows. | 415 | @command{rsh} command, unknown on Windows. |
| 390 | 416 | ||
| 391 | @item comp_cmd=COMMAND [default: "$@{cross_prefix@}gcc -c -I$@{src_dir@} -g -gnatq"] | 417 | @item @code{comp_cmd=@var{command}} [default: @code{"$@{cross_prefix@}gcc -c -I$@{src_dir@} -g -gnatq"}] |
| 392 | Specifies the command used to compile a single file in the application. | 418 | Specifies the command used to compile a single file in the application. |
| 393 | The name of the file will be added at the end of this command. | 419 | The name of the file will be added at the end of this command. |
| 394 | 420 | ||
| 395 | @item make_cmd=COMMAND [default: "$@{cross_prefix@}gnatmake $@{main@} -aI$@{src_dir@} -aO$@{obj_dir@} -g -gnatq -cargs $@{comp_opt@} -bargs $@{bind_opt@} -largs $@{link_opt@}"]' | 421 | @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@}"]}' |
| 396 | Specifies the command used to recompile the whole application. | 422 | Specifies the command used to recompile the whole application. |
| 397 | 423 | ||
| 398 | @item run_cmd=COMMAND [default: "$@{main@}"] | 424 | @item @code{run_cmd=@var{command}} [default: @code{"$@{main@}"}] |
| 399 | Specifies the command used to run the application. | 425 | Specifies the command used to run the application. |
| 400 | 426 | ||
| 401 | @item debug_cmd=COMMAND [default: "$@{cross_prefix@}gdb $@{main@}"] | 427 | @item @code{debug_cmd=@var{command}} [default: @code{"$@{cross_prefix@}gdb $@{main@}"}] |
| 402 | Specifies the command used to debug the application | 428 | Specifies the command used to debug the application |
| 403 | 429 | ||
| 404 | @end table | 430 | @end table |
| @@ -417,23 +443,30 @@ function is used (goto declaration for instance), the following steps | |||
| 417 | are taken: | 443 | are taken: |
| 418 | 444 | ||
| 419 | @itemize @bullet | 445 | @itemize @bullet |
| 420 | @item find the appropriate project file, open and parse it. | 446 | @item |
| 447 | find the appropriate project file, open and parse it. | ||
| 421 | All the fields read in the project file are then stored by emacs | 448 | All the fields read in the project file are then stored by emacs |
| 422 | locally. Finding the project file requires a few steps: | 449 | locally. Finding the project file requires a few steps: |
| 423 | 450 | ||
| 424 | @itemize @minus | 451 | @itemize @minus |
| 425 | @item if a file from the same directory was already associated with | 452 | @item |
| 453 | if a file from the same directory was already associated with | ||
| 426 | a project file, use the same one. This is the variable | 454 | a project file, use the same one. This is the variable |
| 427 | @code{ada-xref-default-prj-file} described above. | 455 | @code{ada-xref-default-prj-file} described above. |
| 428 | @item if the variable @code{ada-prj-default-project-file} is set, | 456 | @item |
| 457 | if the variable @code{ada-prj-default-project-file} is set, | ||
| 429 | use the project file specified in this variable. | 458 | use the project file specified in this variable. |
| 430 | @item if there is a project file whose name is the same as the source file | 459 | @item |
| 431 | except for the suffix, use this one. | 460 | if there is a project file whose name is the same as the source file |
| 432 | @item if there's only one project file in the source directory, use | 461 | except for the suffix, use this one. |
| 462 | @item | ||
| 463 | if there's only one project file in the source directory, use | ||
| 433 | that one. | 464 | that one. |
| 434 | @item if there are more than one project file in the source directory, | 465 | @item |
| 466 | if there are more than one project file in the source directory, | ||
| 435 | ask the user. | 467 | ask the user. |
| 436 | @item if there are no project files in the source directory use standard | 468 | @item |
| 469 | if there are no project files in the source directory use standard | ||
| 437 | default values. | 470 | default values. |
| 438 | @end itemize | 471 | @end itemize |
| 439 | 472 | ||
| @@ -441,19 +474,22 @@ The first project file that is selected in a given directory becomes the | |||
| 441 | default project file for this directory and is used implicitly for other | 474 | default project file for this directory and is used implicitly for other |
| 442 | sources unless specified otherwise by the user. | 475 | sources unless specified otherwise by the user. |
| 443 | 476 | ||
| 444 | @item look for the corresponding .ali file in the @code{obj_dir} defined | 477 | @item |
| 478 | look for the corresponding .ali file in the @code{obj_dir} defined | ||
| 445 | in the project file. If this file can not be found, emacs proposes to | 479 | in the project file. If this file can not be found, emacs proposes to |
| 446 | compile the source using the @code{comp_cmd} defined in the project file | 480 | compile the source using the @code{comp_cmd} defined in the project file |
| 447 | in order to create the ali file. | 481 | in order to create the ali file. |
| 448 | 482 | ||
| 449 | @item when cross referencing is requested, the .ali file is parsed to | 483 | @item |
| 484 | when cross referencing is requested, the .ali file is parsed to | ||
| 450 | determine the file and line of the identifier definition. It is | 485 | determine the file and line of the identifier definition. It is |
| 451 | possible for the .ali file to be older than the source file, in which | 486 | possible for the .ali file to be older than the source file, in which |
| 452 | case it will be recompiled if the variable @code{ada-xref-create-ali} is | 487 | case it will be recompiled if the variable @code{ada-xref-create-ali} is |
| 453 | set, otherwise the reference is searched in the obsolete ali file with | 488 | set, otherwise the reference is searched in the obsolete ali file with |
| 454 | possible inaccurate results. | 489 | possible inaccurate results. |
| 455 | 490 | ||
| 456 | @item look for the file containing the declaration using the source | 491 | @item |
| 492 | look for the file containing the declaration using the source | ||
| 457 | path @code{src_dir} defined in the project file. Put the cursor at the | 493 | path @code{src_dir} defined in the project file. Put the cursor at the |
| 458 | correct position and display this new cursor. | 494 | correct position and display this new cursor. |
| 459 | @end itemize | 495 | @end itemize |
| @@ -463,10 +499,10 @@ correct position and display this new cursor. | |||
| 463 | @chapter Syntax highlighting | 499 | @chapter Syntax highlighting |
| 464 | @c ----------------------------------------------------------------------- | 500 | @c ----------------------------------------------------------------------- |
| 465 | 501 | ||
| 466 | The Ada mode is made to help you understand the structure of your source | 502 | Ada mode is made to help you understand the structure of your source |
| 467 | files. Some people like having colors or different fonts depending on | 503 | files. Some people like having colors or different fonts depending on |
| 468 | the context: commands should be displayed differently than keywords, | 504 | the context: commands should be displayed differently than keywords, |
| 469 | which should also be different from strings, ... | 505 | which should also be different from strings, @dots{} |
| 470 | 506 | ||
| 471 | Emacs is able to display in a different way the following syntactic | 507 | Emacs is able to display in a different way the following syntactic |
| 472 | entities: | 508 | entities: |
| @@ -485,13 +521,13 @@ activate it. This requires that you add a new line in your @file{.emacs} | |||
| 485 | file (if this file does not exist, just create it). | 521 | file (if this file does not exist, just create it). |
| 486 | 522 | ||
| 487 | @example | 523 | @example |
| 488 | (global-font-lock-mode t) | 524 | (global-font-lock-mode t) |
| 489 | @end example | 525 | @end example |
| 490 | 526 | ||
| 491 | But the default colors might not be the ones you like. Fortunately, | 527 | But the default colors might not be the ones you like. Fortunately, |
| 492 | there is a very easy way to change them. Just select the menu | 528 | there is a very easy way to change them. Just select the menu |
| 493 | @kbd{Help->Customize->Specific Face...} and press @kbd{Return}. This | 529 | @samp{Help->Customize->Specific Face...} and press @key{RET}. This |
| 494 | will display a buffer will all the "faces" (the colors) that Emacs knows | 530 | will display a buffer will all the ``faces'' (the colors) that Emacs knows |
| 495 | about. You can change any of them. | 531 | about. You can change any of them. |
| 496 | 532 | ||
| 497 | 533 | ||
| @@ -505,45 +541,50 @@ these functions are available through the Ada menu, and you can also use | |||
| 505 | the following key bindings or the command names: | 541 | the following key bindings or the command names: |
| 506 | 542 | ||
| 507 | @table @kbd | 543 | @table @kbd |
| 508 | @item M-C-e ada-next-procedure | 544 | @item M-C-e |
| 509 | Move to the next function/procedure/task, which ever comes next. | 545 | Move to the next function/procedure/task, which ever comes next |
| 510 | @item M-C-a ada-previous-procedure | 546 | (@code{ada-next-procedure}). |
| 511 | Move to previous function/procedure/task. | 547 | @item M-C-a |
| 512 | @item ada-next-package | 548 | Move to previous function/procedure/task |
| 549 | (@code{ada-previous-procedure}). | ||
| 550 | @item M-x ada-next-package | ||
| 513 | Move to next package. | 551 | Move to next package. |
| 514 | @item ada-prev-package | 552 | @item M-x ada-prev-package |
| 515 | Move to previous package. | 553 | Move to previous package. |
| 516 | @item C-c C-a ada-move-to-start | 554 | @item C-c C-a |
| 517 | Move to matching start of @code{end}. If point is at the end of a | 555 | Move to matching start of @code{end} (@code{ada-move-to-start}). If |
| 518 | subprogram, this command jumps to the corresponding @code{begin} if the | 556 | point is at the end of a subprogram, this command jumps to the |
| 519 | user option @code{ada-move-to-declaration} is @code{nil} (default), it | 557 | corresponding @code{begin} if the user option |
| 520 | jumps to the subprogram declaration otherwise. | 558 | @code{ada-move-to-declaration} is @code{nil} (default), it jumps to |
| 521 | @item C-c C-e ada-move-to-end | 559 | the subprogram declaration otherwise. |
| 522 | Move point to end of current block. | 560 | @item C-c C-e |
| 523 | @item C-c o ff-find-other-file | 561 | Move point to end of current block (@code{ada-move-to-end}). |
| 524 | Switch between corresponding spec and body file. If the cursor is on a | 562 | @item C-c o |
| 525 | subprogram, switch between declaration and body. | 563 | Switch between corresponding spec and body file |
| 564 | (@code{ff-find-other-file}). If the cursor is on a subprogram, switch | ||
| 565 | between declaration and body. | ||
| 526 | @item C-c c-d | 566 | @item C-c c-d |
| 527 | Move from any reference to its declaration and switch between | 567 | Move from any reference to its declaration and switch between |
| 528 | declaration and body (for procedures, tasks, private and incomplete | 568 | declaration and body (for procedures, tasks, private and incomplete |
| 529 | types). | 569 | types). |
| 530 | @item C-c C-r ada-find-references | 570 | @item C-c C-r |
| 531 | runs the @file{gnatfind} command to search for all references to the | 571 | runs the @file{gnatfind} command to search for all references to the |
| 532 | entity pointed by the cursor. Use 'next-error' function, or C-x `, to | 572 | entity pointed by the cursor (@code{ada-find-references}). Use |
| 533 | visit each reference (as for compilation errors). | 573 | @kbd{C-x `} (@code{next-error}) to visit each reference (as for |
| 574 | compilation errors). | ||
| 534 | @end table | 575 | @end table |
| 535 | 576 | ||
| 536 | These functions use the information in the output of the Gnat Ada | 577 | These functions use the information in the output of the Gnat Ada |
| 537 | compiler. However, if your application was compiled with the | 578 | compiler. However, if your application was compiled with the |
| 538 | @code{-gnatx} switch, these functions will not work, since no extra | 579 | @samp{-gnatx} switch, these functions will not work, since no extra |
| 539 | information is generated by GNAT. See GNAT documentation for further | 580 | information is generated by GNAT. See GNAT documentation for further |
| 540 | information. | 581 | information. |
| 541 | 582 | ||
| 542 | Emacs will try to run Gnat for you whenever the cross-reference | 583 | Emacs will try to run Gnat for you whenever the cross-reference |
| 543 | informations are older than your source file (provided the | 584 | informations are older than your source file (provided the |
| 544 | @code{ada-xref-create-ali} variable is non nil). Gnat then produces a | 585 | @code{ada-xref-create-ali} variable is non-@code{nil}). Gnat then produces a |
| 545 | file with the same name as the current Ada file but with the extension | 586 | file with the same name as the current Ada file but with the extension |
| 546 | changed to @code{.ali}. This files are normally used by the binder, but | 587 | changed to @file{.ali}. This files are normally used by the binder, but |
| 547 | they will also contain additional cross-referencing information. | 588 | they will also contain additional cross-referencing information. |
| 548 | 589 | ||
| 549 | @c ----------------------------------------------------------------------- | 590 | @c ----------------------------------------------------------------------- |
| @@ -555,24 +596,26 @@ they will also contain additional cross-referencing information. | |||
| 555 | @section Overview | 596 | @section Overview |
| 556 | @c ----------------------------------------------------------------------- | 597 | @c ----------------------------------------------------------------------- |
| 557 | 598 | ||
| 558 | Emacs and the Ada mode provide two general ways for the completion of | 599 | Emacs and Ada mode provide two general ways for the completion of |
| 559 | identifiers. This is an easy way to type faster: you just have to type | 600 | identifiers. This is an easy way to type faster: you just have to type |
| 560 | the first few letters of an identifiers, and then loop through all the | 601 | the first few letters of an identifiers, and then loop through all the |
| 561 | possible completions. | 602 | possible completions. |
| 562 | 603 | ||
| 563 | The first method is general for Emacs. It will work both with Ada | 604 | The first method is general for Emacs. It will work both with Ada |
| 564 | buffers, but also in C buffers, Java buffers, ... The idea is to parse | 605 | buffers, but also in C buffers, Java buffers, @enddots{} The idea is to parse |
| 565 | all the opened buffers for possible completions. | 606 | all the opened buffers for possible completions. |
| 566 | 607 | ||
| 567 | For instance, if the following words are present in any of the opened | 608 | For instance, if the words @samp{my_identifier}, @samp{my_subprogram} |
| 568 | files: my_identifier, my_subprogam, then you will have this scenario: | 609 | are the only words starting with @samp{my} in any of the opened files, |
| 569 | @example | 610 | then you will have this scenario: |
| 611 | |||
| 612 | @quotation | ||
| 570 | You type: my@key{M-/} | 613 | You type: my@key{M-/} |
| 571 | Emacs will display: my_identifier | 614 | Emacs inserts: @samp{my_identifier} |
| 572 | If you press @key{M-/} once again, Emacs will replace my_identifier with | 615 | If you press @key{M-/} once again, Emacs replaces @samp{my_identifier} with |
| 573 | my_subprogram. | 616 | @samp{my_subprogram}. |
| 574 | Pressing @key{M-/} once more will bring you back to my_identifier. | 617 | Pressing @key{M-/} once more will bring you back to @samp{my_identifier}. |
| 575 | @end example | 618 | @end quotation |
| 576 | 619 | ||
| 577 | This is a very fast way to do completion, and the casing of words will | 620 | This is a very fast way to do completion, and the casing of words will |
| 578 | also be respected. | 621 | also be respected. |
| @@ -583,7 +626,7 @@ files generated by Gnat for possible completions. | |||
| 583 | 626 | ||
| 584 | The main advantage is that this completion is more accurate: only | 627 | The main advantage is that this completion is more accurate: only |
| 585 | existing identifier will be suggested, you don't need to have a file | 628 | existing identifier will be suggested, you don't need to have a file |
| 586 | opened that already contains this identifiers,... | 629 | opened that already contains this identifiers, @enddots{} |
| 587 | 630 | ||
| 588 | On the other hand, this completion is a little bit slower and requires | 631 | On the other hand, this completion is a little bit slower and requires |
| 589 | that you have compiled your file at least once since you created that | 632 | that you have compiled your file at least once since you created that |
| @@ -594,10 +637,11 @@ identifier. | |||
| 594 | @c ----------------------------------------------------------------------- | 637 | @c ----------------------------------------------------------------------- |
| 595 | 638 | ||
| 596 | @table @kbd | 639 | @table @kbd |
| 597 | @item C-TAB ada-complete-identifier | 640 | @item C-@key{TAB} |
| 598 | complete accurately current identifier using information in .ali file | 641 | Complete accurately current identifier using information in @samp{.ali} file |
| 642 | (@code{ada-complete-identifier}). | ||
| 599 | @item M-/ | 643 | @item M-/ |
| 600 | complete identifier using buffer information (not ada specific) | 644 | Complete identifier using buffer information (not Ada-specific). |
| 601 | @end table | 645 | @end table |
| 602 | 646 | ||
| 603 | @c ----------------------------------------------------------------------- | 647 | @c ----------------------------------------------------------------------- |
| @@ -607,8 +651,8 @@ complete identifier using buffer information (not ada specific) | |||
| 607 | 651 | ||
| 608 | You can display a choice menu with all procedure/function/task | 652 | You can display a choice menu with all procedure/function/task |
| 609 | declarations in the file and choose an item by mouse click to get to its | 653 | declarations in the file and choose an item by mouse click to get to its |
| 610 | declaration. This function is accessible through the 'Ada' menu when | 654 | declaration. This function is accessible through the @samp{Ada} menu when |
| 611 | editing a Ada file, or simply through the following key binding : | 655 | editing a Ada file, or simply through the following key binding: |
| 612 | 656 | ||
| 613 | @table @kbd | 657 | @table @kbd |
| 614 | @item C-S-Mouse-3 | 658 | @item C-S-Mouse-3 |
| @@ -627,9 +671,9 @@ would with any file browser. The following commands are then available. | |||
| 627 | 671 | ||
| 628 | You can click on a directory name or file name to open it. The editor | 672 | You can click on a directory name or file name to open it. The editor |
| 629 | will automatically select the best possible mode for this file, | 673 | will automatically select the best possible mode for this file, |
| 630 | including of course the ada-mode for files written in Ada | 674 | including of course Ada mode for files written in Ada. |
| 631 | 675 | ||
| 632 | If you click on the [+] symbol near a file name, all the symbols (types, | 676 | If you click on the @samp{[+]} symbol near a file name, all the symbols (types, |
| 633 | variables and subprograms) defined in that file will be displayed, and | 677 | variables and subprograms) defined in that file will be displayed, and |
| 634 | you can directly click on them to open the right file at the right | 678 | you can directly click on them to open the right file at the right |
| 635 | place. | 679 | place. |
| @@ -642,7 +686,7 @@ following key binding | |||
| 642 | (global-set-key [f7] 'speedbar-get-focus) | 686 | (global-set-key [f7] 'speedbar-get-focus) |
| 643 | @end example | 687 | @end example |
| 644 | 688 | ||
| 645 | Every time you press @key{f7}, the mouse will automatically move to the | 689 | Every time you press @key{F7}, the mouse will automatically move to the |
| 646 | speedbar frame (which will be created if it does not exist). | 690 | speedbar frame (which will be created if it does not exist). |
| 647 | 691 | ||
| 648 | @c ----------------------------------------------------------------------- | 692 | @c ----------------------------------------------------------------------- |
| @@ -650,90 +694,93 @@ speedbar frame (which will be created if it does not exist). | |||
| 650 | @chapter Automatic Smart Indentation | 694 | @chapter Automatic Smart Indentation |
| 651 | @c ----------------------------------------------------------------------- | 695 | @c ----------------------------------------------------------------------- |
| 652 | 696 | ||
| 653 | The Ada mode comes with a full set of rules for automatic indentation. | 697 | Ada mode comes with a full set of rules for automatic indentation. |
| 654 | You can of course configure the indentation as you want, by setting the | 698 | You can of course configure the indentation as you want, by setting the |
| 655 | value of a few variables. | 699 | value of a few variables. |
| 656 | 700 | ||
| 657 | As always, the preferred way to modify variables is to use the | 701 | As always, the preferred way to modify variables is to use the |
| 658 | @code{Ada->Customize} menu (don't forget to save your changes!). This | 702 | @samp{Ada->Customize} menu (don't forget to save your changes!). This |
| 659 | will also show you some example of code where this variable is used, and | 703 | will also show you some example of code where this variable is used, and |
| 660 | hopefully make things clearer. | 704 | hopefully make things clearer. |
| 661 | 705 | ||
| 662 | The relevant variables are the following: | 706 | The relevant variables are the following: |
| 663 | 707 | ||
| 664 | @table @code | 708 | @table @asis |
| 665 | @item ada-broken-indent (default value: 2) | 709 | @item @code{ada-broken-indent} (default value: 2) |
| 666 | Number of columns to indent the continuation of a broken line | 710 | Number of columns to indent the continuation of a broken line. |
| 667 | 711 | ||
| 668 | @item ada-indent (default value: 3) | 712 | @item @code{ada-indent} (default value: 3) |
| 669 | Width of the default indentation | 713 | Width of the default indentation. |
| 670 | 714 | ||
| 671 | @item ada-indent-record-rel-type (default value: 3) | 715 | @item @code{ada-indent-record-rel-type} (default value: 3) |
| 672 | Indentation for 'record' relative to 'type' or 'use' | 716 | Indentation for @code{record} relative to @code{type} or @code{use}. |
| 673 | 717 | ||
| 674 | @item ada-indent-return (default value: 0) | 718 | @item @code{ada-indent-return} (default value: 0) |
| 675 | Indentation for 'return' relative to 'function' (if ada-indent-return | 719 | Indentation for @code{return} relative to @code{function} (if |
| 676 | is greater than 0), or the open parenthesis (if ada-indent-return is | 720 | @code{ada-indent-return} is greater than 0), or the open parenthesis |
| 677 | negative or null). Note that in the second case, when there is no | 721 | (if @code{ada-indent-return} is negative or null). Note that in the second |
| 678 | open parenthesis, the indentation is done relative to 'function' with | 722 | case, when there is no open parenthesis, the indentation is done |
| 679 | the value of ada-broken-indent. | 723 | relative to @code{function} with the value of @code{ada-broken-indent}. |
| 680 | 724 | ||
| 681 | @item ada-label-indent (default value: -4) | 725 | @item @code{ada-label-indent} (default value: -4) |
| 682 | Number of columns to indent a label | 726 | Number of columns to indent a label. |
| 683 | 727 | ||
| 684 | @item ada-stmt-end-indent (default value: 0) | 728 | @item @code{ada-stmt-end-indent} (default value: 0) |
| 685 | Number of columns to indent a statement 'end' keyword on a separate line | 729 | Number of columns to indent a statement @code{end} keyword on a separate line. |
| 686 | 730 | ||
| 687 | @item ada-when-indent (default value: 3) | 731 | @item @code{ada-when-indent} (default value: 3) |
| 688 | Indentation for 'when' relative to 'exception' or 'case' | 732 | Indentation for @code{when} relative to @code{exception} or @code{case}. |
| 689 | 733 | ||
| 690 | @item ada-indent-is-separate (default value: t) | 734 | @item @code{ada-indent-is-separate} (default value: t) |
| 691 | Non-nil means indent 'is separate' or 'is abstract' if on a single line | 735 | Non-@code{nil} means indent @code{is separate} or @code{is abstract} if on a single line. |
| 692 | 736 | ||
| 693 | @item ada-indent-to-open-paren (default value: t) | 737 | @item @code{ada-indent-to-open-paren} (default value: t) |
| 694 | Non-nil means indent according to the innermost open parenthesis | 738 | Non-@code{nil} means indent according to the innermost open parenthesis. |
| 695 | |||
| 696 | @item ada-indent-after-return (default value: t) | ||
| 697 | Non-nil means that the current line will also be re-indented before | ||
| 698 | inserting a newline, when you press @kbd{Return}. | ||
| 699 | 739 | ||
| 740 | @item @code{ada-indent-after-return} (default value: t) | ||
| 741 | Non-@code{nil} means that the current line will also be re-indented before | ||
| 742 | inserting a newline, when you press @key{RET}. | ||
| 700 | @end table | 743 | @end table |
| 701 | 744 | ||
| 702 | Most of the time, the indentation will be automatic, i.e when you will | 745 | Most of the time, the indentation will be automatic, i.e when you will |
| 703 | press @kbd{Return}, the cursor will move to the correct column on the | 746 | press @key{RET}, the cursor will move to the correct column on the |
| 704 | next line. | 747 | next line. |
| 705 | 748 | ||
| 706 | However, you might want or need sometimes to re-indent the current line | 749 | However, you might want or need sometimes to re-indent the current line |
| 707 | or a set of lines. For this, you can simply go to that line, or select | 750 | or a set of lines. For this, you can simply go to that line, or select |
| 708 | the lines, and then press @kbd{TAB}. This will automatically re-indent | 751 | the lines, and then press @key{TAB}. This will automatically re-indent |
| 709 | the lines. | 752 | the lines. |
| 710 | 753 | ||
| 711 | Another mode of indentation exists that helps you to set up your | 754 | Another mode of indentation exists that helps you to set up your |
| 712 | indentation scheme. If you press @kbd{C-c TAB}, the ada-mode will do the | 755 | indentation scheme. If you press @kbd{C-c @key{TAB}}, Ada mode will do |
| 713 | following: | 756 | the following: |
| 757 | |||
| 714 | @itemize @bullet | 758 | @itemize @bullet |
| 715 | @item Reindent the current line, as @kbd{TAB} would do | 759 | @item |
| 716 | @item Temporarily move the cursor to a reference line, i.e the line that | 760 | Reindent the current line, as @key{TAB} would do. |
| 717 | was used to calculate the current indentation | 761 | @item |
| 718 | @item Display at the bottom of the window the name of the variable that | 762 | Temporarily move the cursor to a reference line, i.e., the line that |
| 719 | provided the offset for the indentation | 763 | was used to calculate the current indentation. |
| 764 | @item | ||
| 765 | Display at the bottom of the window the name of the variable that | ||
| 766 | provided the offset for the indentation. | ||
| 720 | @end itemize | 767 | @end itemize |
| 721 | 768 | ||
| 722 | The exact indentation of the current line is the same as the one for the | 769 | The exact indentation of the current line is the same as the one for the |
| 723 | reference line, plus an offset given by the variable. | 770 | reference line, plus an offset given by the variable. |
| 724 | 771 | ||
| 725 | Once you know the name of the variable, you can either modify it through | 772 | Once you know the name of the variable, you can either modify it |
| 726 | the usual @key{Ada->Customize} menu, or by typing @key{M-x | 773 | through the usual @samp{Ada->Customize} menu, or by typing @kbd{M-x |
| 727 | customize-variable RET} in the Emacs window, and then give the name of | 774 | customize-variable @key{RET}} in the Emacs window, and then give the |
| 728 | the variable. | 775 | name of the variable. |
| 729 | 776 | ||
| 730 | @table @kbd | 777 | @table @kbd |
| 731 | @item TAB | 778 | @item @key{TAB} |
| 732 | indent the current line or the current region. | 779 | Indent the current line or the current region. |
| 733 | @item M-C-\ | 780 | @item M-C-\ |
| 734 | indent lines in the current selected block. | 781 | Indent lines in the current selected block. |
| 735 | @item C-c TAB | 782 | @item C-c @key{TAB} |
| 736 | indent the current line and prints the name of the variable used for | 783 | Indent the current line and prints the name of the variable used for |
| 737 | indentation. | 784 | indentation. |
| 738 | @end table | 785 | @end table |
| 739 | 786 | ||
| @@ -744,15 +791,15 @@ indentation. | |||
| 744 | @chapter Formatting Parameter Lists | 791 | @chapter Formatting Parameter Lists |
| 745 | @c ----------------------------------------------------------------------- | 792 | @c ----------------------------------------------------------------------- |
| 746 | 793 | ||
| 747 | To help you correctly align fields in a subprogram parameter list, Emacs | 794 | To help you correctly align fields in a subprogram parameter list, |
| 748 | provides one function that will do most of the work for you. This | 795 | Emacs provides one function that will do most of the work for you. |
| 749 | function will align the declarations on the colon (':') separating | 796 | This function will align the declarations on the colon (@samp{:}) |
| 750 | argument names and argument types, plus align the 'in', 'out' and 'in | 797 | separating argument names and argument types, plus align the |
| 751 | out' keywords if required. | 798 | @code{in}, @code{out} and @code{in out} keywords if required. |
| 752 | 799 | ||
| 753 | @table @kbd | 800 | @table @kbd |
| 754 | @item C-c C-f ada-format-paramlist | 801 | @item C-c C-f |
| 755 | Format the parameter list. | 802 | Format the parameter list (@code{ada-format-paramlist}). |
| 756 | @end table | 803 | @end table |
| 757 | 804 | ||
| 758 | @c ----------------------------------------------------------------------- | 805 | @c ----------------------------------------------------------------------- |
| @@ -772,7 +819,7 @@ attributes and identifiers. The relevant variables are the following: | |||
| 772 | 819 | ||
| 773 | All these variables can have one of the following values: | 820 | All these variables can have one of the following values: |
| 774 | 821 | ||
| 775 | @table @kbd | 822 | @table @code |
| 776 | @item downcase-word | 823 | @item downcase-word |
| 777 | The previous word will simply be in all lower cases. For instance | 824 | The previous word will simply be in all lower cases. For instance |
| 778 | @code{My_vARIable} is converted to @code{my_variable}. | 825 | @code{My_vARIable} is converted to @code{my_variable}. |
| @@ -783,12 +830,12 @@ The previous word will be fully converted to upper cases. For instance | |||
| 783 | 830 | ||
| 784 | @item ada-capitalize-word | 831 | @item ada-capitalize-word |
| 785 | All letters, except the first one of the word and every letter after the | 832 | All letters, except the first one of the word and every letter after the |
| 786 | '_' character are lower cased. Other letters are upper cased. For | 833 | @samp{_} character are lower cased. Other letters are upper cased. For |
| 787 | instance @code{My_vARIable} is converted to @code{My_Variable}. | 834 | instance @code{My_vARIable} is converted to @code{My_Variable}. |
| 788 | 835 | ||
| 789 | @item ada-loose-case-word | 836 | @item ada-loose-case-word |
| 790 | No letters is modified in the previous word, except the ones after the | 837 | No letters is modified in the previous word, except the ones after the |
| 791 | '_' character that are upper cased. For instance @code{My_vARIable} is | 838 | @samp{_} character that are upper cased. For instance @code{My_vARIable} is |
| 792 | converted to @code{My_VARIable}. | 839 | converted to @code{My_VARIable}. |
| 793 | @end table | 840 | @end table |
| 794 | 841 | ||
| @@ -805,7 +852,7 @@ through the variable @code{ada-case-exception-file}. | |||
| 805 | Note that each line in this file must start with the key word whose | 852 | Note that each line in this file must start with the key word whose |
| 806 | casing you want to specify. The rest of the line can be used for | 853 | casing you want to specify. The rest of the line can be used for |
| 807 | comments (explaining for instance what an abbreviation means, as | 854 | comments (explaining for instance what an abbreviation means, as |
| 808 | recommended in the Ada 95 Quality and Style, paragrpah 3.1.4). Thus, a | 855 | recommended in the Ada 95 Quality and Style, paragraph 3.1.4). Thus, a |
| 809 | good example for this file could be: | 856 | good example for this file could be: |
| 810 | 857 | ||
| 811 | @example | 858 | @example |
| @@ -825,7 +872,7 @@ as you would edit any text file, and add or suppress entries in this | |||
| 825 | file. Remember that you should put one entity per line. The other, | 872 | file. Remember that you should put one entity per line. The other, |
| 826 | easier way, is to position the cursor over the word you want to add, in | 873 | easier way, is to position the cursor over the word you want to add, in |
| 827 | an Ada buffer. This word should have the casing you want. Then simply | 874 | an Ada buffer. This word should have the casing you want. Then simply |
| 828 | select the menu @kbd{Ada->Edit->Create Case Exception}, or the key | 875 | select the menu @samp{Ada->Edit->Create Case Exception}, or the key |
| 829 | @kbd{C-c C-y}. The word will automatically be added to the current list | 876 | @kbd{C-c C-y}. The word will automatically be added to the current list |
| 830 | of exceptions and to the file. | 877 | of exceptions and to the file. |
| 831 | 878 | ||
| @@ -842,6 +889,7 @@ only. You can not automatically add an exception to one of the other | |||
| 842 | files, although you can of course edit the files by hand at any time. | 889 | files, although you can of course edit the files by hand at any time. |
| 843 | 890 | ||
| 844 | Automatic casing can be performed on port or whole buffer using: | 891 | Automatic casing can be performed on port or whole buffer using: |
| 892 | |||
| 845 | @table @kbd | 893 | @table @kbd |
| 846 | @item C-c C-b | 894 | @item C-c C-b |
| 847 | Adjust case in the whole buffer. | 895 | Adjust case in the whole buffer. |
| @@ -933,7 +981,7 @@ additional functions to handle comments: | |||
| 933 | Start a comment in default column. | 981 | Start a comment in default column. |
| 934 | @item M-j | 982 | @item M-j |
| 935 | Continue comment on next line. | 983 | Continue comment on next line. |
| 936 | @item C-c ; comment-region | 984 | @item C-c ; |
| 937 | Comment the selected region (add -- at the beginning of lines). | 985 | Comment the selected region (add -- at the beginning of lines). |
| 938 | @item C-c : | 986 | @item C-c : |
| 939 | Uncomment the selected region | 987 | Uncomment the selected region |
| @@ -978,7 +1026,7 @@ customized with the variable @code{comp_opt} of the project file. | |||
| 978 | Emacs will display a new buffer that contains the result of the | 1026 | Emacs will display a new buffer that contains the result of the |
| 979 | compilation. Each line associated with an error will become active: you | 1027 | compilation. Each line associated with an error will become active: you |
| 980 | can simply click on it with the middle button of the mouse, or move the | 1028 | can simply click on it with the middle button of the mouse, or move the |
| 981 | cursor on it and press @kbd{Return}. Emacs will then display the | 1029 | cursor on it and press @key{RET}. Emacs will then display the |
| 982 | relevant source file and put the cursor on the line and column the error | 1030 | relevant source file and put the cursor on the line and column the error |
| 983 | was found at. | 1031 | was found at. |
| 984 | 1032 | ||
| @@ -1041,23 +1089,23 @@ also set a breakpoint simply by right-clicking on a line. | |||
| 1041 | You can easily use Emacs as the source window when you are using a | 1089 | You can easily use Emacs as the source window when you are using a |
| 1042 | graphical interface for the debugger. The interesting thing is that, | 1090 | graphical interface for the debugger. The interesting thing is that, |
| 1043 | whereas you still have the graphical nifties, you can also you the | 1091 | whereas you still have the graphical nifties, you can also you the |
| 1044 | cross-references features that the ada-mode provides to look at the | 1092 | cross-references features that Ada mode provides to look at the |
| 1045 | definition for the identifiers,... | 1093 | definition for the identifiers, @enddots{} |
| 1046 | 1094 | ||
| 1047 | Here is how you can set up gdbtk and ddd for use with Emacs (These are | 1095 | Here is how you can set up gdbtk and ddd for use with Emacs (These are |
| 1048 | the commands you should setup in the project file): | 1096 | the commands you should setup in the project file): |
| 1049 | 1097 | ||
| 1050 | @itemize @bullet | 1098 | @itemize @bullet |
| 1051 | @item gdbtk | 1099 | @item gdbtk |
| 1052 | should be used with the switch --emacs_gdbtk. It provides a nice | 1100 | should be used with the switch @samp{--emacs_gdbtk}. It provides a nice |
| 1053 | backtrace window, as well as a tasks window. You can click interactively | 1101 | backtrace window, as well as a tasks window. You can click interactively |
| 1054 | on both of them, and Emacs will display the source file on the correct | 1102 | on both of them, and Emacs will display the source file on the correct |
| 1055 | line. | 1103 | line. |
| 1056 | 1104 | ||
| 1057 | @item ddd (Data Display Debugger) | 1105 | @item ddd (Data Display Debugger) |
| 1058 | should be used with the switches --tty and -fullname. Whenever you | 1106 | should be used with the switches @samp{--tty} and |
| 1059 | print a variable from Emacs, it will be displayed graphically in the | 1107 | @samp{--fullname}. Whenever you print a variable from Emacs, it will |
| 1060 | data window. | 1108 | be displayed graphically in the data window. |
| 1061 | 1109 | ||
| 1062 | @end itemize | 1110 | @end itemize |
| 1063 | 1111 | ||
| @@ -1069,19 +1117,19 @@ data window. | |||
| 1069 | 1117 | ||
| 1070 | By default, Emacs is configured to use the GNAT style file names, where | 1118 | By default, Emacs is configured to use the GNAT style file names, where |
| 1071 | file names are the package names, and the extension for spec and bodies | 1119 | file names are the package names, and the extension for spec and bodies |
| 1072 | are respectively .ads and .adb. | 1120 | are respectively @samp{.ads} and @samp{.adb}. |
| 1073 | 1121 | ||
| 1074 | If you want to use other types of file names, you will need to modify | 1122 | If you want to use other types of file names, you will need to modify |
| 1075 | your .emacs configuration file. | 1123 | your @file{.emacs} file. |
| 1076 | 1124 | ||
| 1077 | Adding new possible extensions is easy. Since the ada-mode needs to know | 1125 | Adding new possible extensions is easy. Since Ada mode needs to know |
| 1078 | how to go from the body to the spec (and back), you always have to | 1126 | how to go from the body to the spec (and back), you always have to |
| 1079 | specify both. A function is provided with the ada-mode to add new | 1127 | specify both. A function is provided with Ada mode to add new |
| 1080 | extensions. | 1128 | extensions. |
| 1081 | 1129 | ||
| 1082 | For instance, if your files are called <unit>_s.ada and <unit>_b.ada | 1130 | For instance, if your spec and bodies files are called |
| 1083 | respectively for spec and bodies, you need to add the following to your | 1131 | @file{@var{unit}_s.ada} and @file{@var{unit}_b.ada}, respectively, you |
| 1084 | @file{.emacs} : | 1132 | need to add the following to your @file{.emacs} file: |
| 1085 | 1133 | ||
| 1086 | @example | 1134 | @example |
| 1087 | (ada-add-extensions "_s.ada" "_b.ada") | 1135 | (ada-add-extensions "_s.ada" "_b.ada") |
| @@ -1100,10 +1148,10 @@ a file whose extension is @file{.ads}, it will take the first available | |||
| 1100 | file that ends with either @file{.adb} (standard), @file{_b.ada} or | 1148 | file that ends with either @file{.adb} (standard), @file{_b.ada} or |
| 1101 | @file{.body}. | 1149 | @file{.body}. |
| 1102 | 1150 | ||
| 1103 | If the filename is not the unit name, then things are a little more | 1151 | If the filename is not the unit name, then things are a little more |
| 1104 | complicated. You then need to rewrite the function | 1152 | complicated. You then need to rewrite the function |
| 1105 | ada-make-filename-from-adaname (see the file @file{ada-mode.el} for an | 1153 | @code{ada-make-filename-from-adaname} (see the file @file{ada-mode.el} |
| 1106 | example). | 1154 | for an example). |
| 1107 | 1155 | ||
| 1108 | @c --------------------------------------------------------------------- | 1156 | @c --------------------------------------------------------------------- |
| 1109 | @node Working Remotely, ,Using non-standard file names, Top | 1157 | @node Working Remotely, ,Using non-standard file names, Top |
| @@ -1126,15 +1174,16 @@ machine and the remote machine that stores your files. This is a special | |||
| 1126 | Emacs mode, called @code{ange-ftp}. To use it, you just have to use a | 1174 | Emacs mode, called @code{ange-ftp}. To use it, you just have to use a |
| 1127 | slightly different syntax when you open a file. | 1175 | slightly different syntax when you open a file. |
| 1128 | 1176 | ||
| 1129 | @example | 1177 | For instance, if you want to open the file @file{/work/foo.adb} on the machine |
| 1130 | For instance, if you want to open the file /work/foo.adb on the machine | ||
| 1131 | aleph.gnu.org, where you log in as qwe, you would simply do this: | 1178 | aleph.gnu.org, where you log in as qwe, you would simply do this: |
| 1132 | 1179 | ||
| 1133 | @key{C-x C-f} /qwe@@aleph.gnu.org:/work/foo.adb @key{Return} | 1180 | @example |
| 1134 | 1181 | C-x C-f /qwe@@aleph.gnu.org:/work/foo.adb @key{RET} | |
| 1135 | i.e put your name, the name of the machine and the name of the file. | ||
| 1136 | @end example | 1182 | @end example |
| 1137 | 1183 | ||
| 1184 | @noindent | ||
| 1185 | i.e., use your name, the name of the machine and the name of the file. | ||
| 1186 | |||
| 1138 | The first time, Emacs will ask you for a password that it will remember | 1187 | The first time, Emacs will ask you for a password that it will remember |
| 1139 | until you close the current Emacs. Even if the ftp session times out, | 1188 | until you close the current Emacs. Even if the ftp session times out, |
| 1140 | you won't need to reenter your password. | 1189 | you won't need to reenter your password. |
| @@ -1150,7 +1199,7 @@ If the machine you want to compile on is not the one your Emacs is | |||
| 1150 | running on, you can set the variable @code{remote_machine} in the | 1199 | running on, you can set the variable @code{remote_machine} in the |
| 1151 | project file for your application. | 1200 | project file for your application. |
| 1152 | 1201 | ||
| 1153 | This will force Emacs to issue a rsh command for the compilation, | 1202 | This will force Emacs to issue a @command{rsh} command for the compilation, |
| 1154 | instead of running it on the local machine. Unfortunately, this won't | 1203 | instead of running it on the local machine. Unfortunately, this won't |
| 1155 | work on Windows workstations, since this protocol is not supported. | 1204 | work on Windows workstations, since this protocol is not supported. |
| 1156 | 1205 | ||
| @@ -1170,7 +1219,7 @@ compilation, you need to insert a call to the appropriate initialization | |||
| 1170 | script in the compilation command, for instance: | 1219 | script in the compilation command, for instance: |
| 1171 | 1220 | ||
| 1172 | @example | 1221 | @example |
| 1173 | build_cmd= initialization_script ; cd /work/ && gnatmake foo | 1222 | build_cmd= initialization_script; cd /work/ && gnatmake foo |
| 1174 | @end example | 1223 | @end example |
| 1175 | 1224 | ||
| 1176 | @c --------------------------------------------------------------------- | 1225 | @c --------------------------------------------------------------------- |
| @@ -1180,15 +1229,12 @@ build_cmd= initialization_script ; cd /work/ && gnatmake foo | |||
| 1180 | This feature is not completely implemented yet. | 1229 | This feature is not completely implemented yet. |
| 1181 | 1230 | ||
| 1182 | However, most of the time, you will be able to run your application | 1231 | However, most of the time, you will be able to run your application |
| 1183 | remotely simply by replacing it with a 'rsh' call on Unix. | 1232 | remotely simply by replacing it with a @command{rsh} call. |
| 1184 | 1233 | For instance, if your command was @code{$@{main@}}, you could replace it with | |
| 1185 | @example | 1234 | @code{rsh aleph.gnu.org $@{main@}}. |
| 1186 | For instance, if your command was '$@{main@}', you could replace it with | ||
| 1187 | 'rsh aleph.gnu.org $@{main@}'. | ||
| 1188 | @end example | ||
| 1189 | 1235 | ||
| 1190 | However, this would not fully work for instance on vxworks, where rsh | 1236 | However, this would not work on vxworks, for instance, where |
| 1191 | is not supported. | 1237 | @command{rsh} is not supported. |
| 1192 | 1238 | ||
| 1193 | @contents | 1239 | @contents |
| 1194 | @bye | 1240 | @bye |