]> code.delx.au - gnu-emacs-elpa/blob - packages/ada-mode/ada-mode.info
Add ada-mode, wisi packages
[gnu-emacs-elpa] / packages / ada-mode / ada-mode.info
1 This is ../ada-mode.info, produced by makeinfo version 4.13 from
2 ../ada-mode.texi.
3
4 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
5 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
6
7 Permission is granted to copy, distribute and/or modify this
8 document under the terms of the GNU Free Documentation License,
9 Version 1.3 or any later version published by the Free Software
10 Foundation; with no Invariant Sections, with the Front-Cover texts
11 being "A GNU Manual", and with the Back-Cover Texts as in (a)
12 below. A copy of the license is included in the section entitled
13 "GNU Free Documentation License".
14
15 (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
16 modify this GNU manual. Buying copies from the FSF supports it in
17 developing GNU and promoting software freedom."
18
19 INFO-DIR-SECTION Emacs editing modes
20 START-INFO-DIR-ENTRY
21 * Ada mode: (ada-mode). Emacs mode for editing and navigating Ada code.
22 END-INFO-DIR-ENTRY
23
24 \1f
25 File: ada-mode.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir)
26
27 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
28 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
29
30 Permission is granted to copy, distribute and/or modify this
31 document under the terms of the GNU Free Documentation License,
32 Version 1.3 or any later version published by the Free Software
33 Foundation; with no Invariant Sections, with the Front-Cover texts
34 being "A GNU Manual", and with the Back-Cover Texts as in (a)
35 below. A copy of the license is included in the section entitled
36 "GNU Free Documentation License".
37
38 (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
39 modify this GNU manual. Buying copies from the FSF supports it in
40 developing GNU and promoting software freedom."
41
42 * Menu:
43
44 * Overview::
45 * Installation:: Installing Ada mode on your system
46 * Customization:: Setting up Ada mode to your taste
47 * Compiling Executing:: Working with your application within Emacs
48 * Project files:: Describing the organization of your project
49 * Moving Through Ada Code:: Moving easily through Ada sources
50 * Identifier completion:: Finishing words automatically
51 * Indentation:: Indenting your code automatically as you type
52 * Statement skeletons::
53 * Aligning code::
54 * Automatic casing:: Adjusting the case of words automatically
55 * Comment Handling:: Reformatting comments easily
56 * Key summary::
57 * Developer overview::
58 * GNU Free Documentation License::
59 * Index::
60
61 \1f
62 File: ada-mode.info, Node: Overview, Next: Installation, Prev: Top, Up: Top
63
64 1 Overview
65 **********
66
67 The Emacs mode for programming in Ada helps the user in reading
68 existing code and facilitates writing new code.
69
70 When the Gnu Ada compiler GNAT is used, the cross-reference
71 information output by the compiler is used to provide powerful code
72 navigation (jump to definition, find all uses, etc).
73
74 When you open a file with a file extension of `.ads' or `.adb',
75 Emacs will automatically load and activate Ada mode.
76
77 Ada mode works without any customization, if you are using the GNAT
78 compiler (`https://libre2.adacore.com/') and the GNAT default naming
79 convention.
80
81 You must customize a few things if you are using a different file
82 naming convention or compiler; *Note Other compiler::, *Note
83 Non-standard file names::.
84
85 In addition, you may want to customize the indentation,
86 capitalization, and other things; *Note Other customization::.
87
88 Finally, for large Ada projects, you will want to set up an Emacs
89 Ada mode project file for each project; *Note Project files::. Note
90 that these are different from the GNAT project files used by gnatmake
91 and other GNAT commands.
92
93 *Note Running Debuggers Under Emacs: (emacs)Running Debuggers Under
94 Emacs, for general information on debugging.
95
96 \1f
97 File: ada-mode.info, Node: Installation, Next: Customization, Prev: Overview, Up: Top
98
99 2 Installation
100 **************
101
102 Ada mode is part of the standard Emacs distribution; if you use that,
103 no files need to be installed.
104
105 Ada mode is also available as a separate distribution, from the Emacs
106 Ada mode website
107 `http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html'. The
108 separate distribution may be more recent.
109
110 For installing the separate distribution, see the `README' file in
111 the distribution.
112
113 To see what version of Ada mode you have installed, do `M-x
114 ada-mode-version'.
115
116 * Menu:
117
118 * gnatinspect::
119
120 \1f
121 File: ada-mode.info, Node: gnatinspect, Prev: Installation, Up: Installation
122
123 2.1 gnatinspect
124 ===============
125
126 Ada mode has experimental support for the new AdaCore cross reference
127 tool `gnatinspect', which supports Ada, C, C++, and any other language
128 for which gcc provices the `-fdump-xref'.
129
130 `gnatinspect' is distributed as part of `gnatcoll'. Ada mode
131 requires the very latest version, in `gnatcoll 1.7w' distributed with
132 GNATPro 7.2 preview.
133
134 To build `gnatinspect':
135 tar xf ~/Downloads/gnatcoll-1.7w-src.tgz
136 cd gnatcoll-1.7w-src
137 ./configure --prefix=/usr/gnat-7.1.2
138 make Gnatcoll_Build=Debug
139 sudo make Gnatcoll_Build=Debug install
140
141 \1f
142 File: ada-mode.info, Node: Customization, Next: Compiling Executing, Prev: Installation, Up: Top
143
144 3 Customizing Ada mode
145 **********************
146
147 Here we assume you are familiar with setting variables in Emacs, either
148 thru 'customize' or in elisp (in your `.emacs' file). For a basic
149 introduction to customize, elisp, and Emacs in general, see the
150 tutorial (`C-h t').
151
152 * Menu:
153
154 * Non-standard file names::
155 * Other compiler::
156 * Other cross-reference::
157 * Other customization::
158
159 \1f
160 File: ada-mode.info, Node: Non-standard file names, Next: Other compiler, Prev: Customization, Up: Customization
161
162 3.1 Non-standard file names
163 ===========================
164
165 By default, Ada mode is configured to use the GNAT file naming
166 convention, where file names are a simple modification of the Ada
167 names, and the extension for specs and bodies are `.ads' and `.adb',
168 respectively.
169
170 Emacs uses the file extension to enable Ada mode; Ada mode uses the
171 file extentions to allow moving from a package body to the
172 corresponding spec and back.
173
174 Emacs and Ada mode support ways to use alternative file extensions
175 for specs and bodies. Note that you must also tell the compiler about
176 these extensions; doing that is beyond the scope of this manual.
177
178 For instance, if your spec and bodies files are called `UNIT_s.ada'
179 and `UNIT_b.ada', respectively, you can add the following to your
180 `.emacs' file:
181
182 ;; Tell Ada mode about spec and body extensions
183 (ada-add-extensions "_s.ada" "_b.ada")
184
185 ;; Tell Emacs to use Ada mode for those extensions
186 (add-to-list 'auto-mode-alist '("\\.ada\\'" . ada-mode))
187
188 You can define additional extensions:
189
190 (ada-add-extensions ".ads" "_b.ada")
191 (ada-add-extensions ".ads" ".body")
192
193 This means that whenever Ada mode looks for the body for a file
194 whose extension is `.ads', it will take the first available file that
195 ends with either `.adb', `_b.ada' or `.body'.
196
197 Simililarly, if Ada mode is looking for a spec, it will look for
198 `.ads' or `_s.ada'.
199
200 If the filename excluding the extension is not derived from the Ada
201 name following the GNAT convention, you need to provide an alternate
202 function for `ada-file-name-from-ada-name'. Doing that is beyond the
203 scope of this manual; see the current definitions in `ada-mode.el' and
204 `ada-gnat.el' for examples.
205
206 \1f
207 File: ada-mode.info, Node: Other compiler, Next: Other cross-reference, Prev: Non-standard file names, Up: Customization
208
209 3.2 Other compiler
210 ==================
211
212 The project variable `ada_compiler' (default elisp variable
213 `ada-compiler') is used to index several variables that point to the
214 compiler-specific functions for corresponding Ada mode operations.
215
216 To use a compiler other than GNAT, you must write Emacs lisp code
217 that provides the interface to the compiler, and set `ada-compiler' and
218 the indirection variables.
219
220 See `ada-gnat-compile.el' for an example.
221
222 \1f
223 File: ada-mode.info, Node: Other cross-reference, Next: Other customization, Prev: Other compiler, Up: Customization
224
225 3.3 Other cross-reference
226 =========================
227
228 The project variable `ada_xref' (default elisp variable
229 `ada-xref-tool') is used to index several variables that point to the
230 cross-reference-tool-specific functions for corresponding Ada mode
231 operations.
232
233 To use a cross reference tool other than gnatxref, you must write
234 Emacs lisp code that provides the interface to the compiler, and set
235 `ada-xref-tool' and the indirection variables. This has already been
236 done for `gnatinspect'; set `ada-xref-tool' to `'gnat_inspect'.
237
238 See `ada-gnat-xref.el' and `gnat-inspect.el' for examples.
239
240 \1f
241 File: ada-mode.info, Node: Other customization, Prev: Other cross-reference, Up: Customization
242
243 3.4 Other customization
244 =======================
245
246 All user-settable Ada mode variables can be set via the menu `Ada |
247 Customize'. Click on the `Help' button there for help on using
248 customize.
249
250 To modify a specific variable, you can directly call the function
251 `customize-variable'; just type `M-x customize-variable <RET>
252 VARIABLE-NAME <RET>').
253
254 Alternately, you can specify variable settings in the Emacs
255 configuration file, `~/.emacs'. This file is coded in Emacs lisp, and
256 the syntax to set a variable is the following:
257 (setq variable-name value)
258
259 Some general Emacs settings that are useful for Ada files:
260 `delete-trailing-whitespace'
261 Deletes space, tab at end of line and blank lines at end of buffer.
262
263 `untabify'
264 Deletes tab characters that have crept into the file.
265
266 `indent-tabs-mode'
267 Don't insert tab characters when indenting.
268
269 `copyright-update'
270 Updates the copyright date in the file header comment, to the
271 current year.
272
273 `electric-pair-mode'
274 Insert a matching right paren when you type a left paren.
275
276 `hippie-expand'
277 Bind hippie-expand to a key; it expands the word before point,
278 using words from current buffer, other buffers, file names, etc;
279 see `hippie-expand-try-functions-list'. You can also add
280 `ada-skel-hippie-try' to that list. Note that `ada-expand', which
281 defaults to `ada-skel-expand', is bound to <C-c C-e> (*note
282 Statement skeletons::).
283
284 The above can all be set by the following code in your `~/.emacs'.
285 Note that some are functions are added to `before-save-hook'; they run
286 just before a buffer is written to disk.
287 (setq-default indent-tabs-mode nil)
288 (electric-pair-mode 1)
289 (require 'ada-mode)
290 (add-to-list 'hippie-expand-try-functions-list 'ada-skel-hippie-try)
291 (define-key ada-mode-map "\C-e" 'hippie-expand)
292 (add-hook 'ada-mode-hook
293 (lambda ()
294 (add-hook 'before-save-hook 'delete-trailing-whitespace nil t)
295 (add-hook 'before-save-hook 'copyright-update nil t)
296 (add-hook 'before-save-hook
297 (lambda () (untabify (point-min) (point-max)))
298 nil t)))
299
300 \1f
301 File: ada-mode.info, Node: Compiling Executing, Next: Project files, Prev: Customization, Up: Top
302
303 4 Compiling Executing
304 *********************
305
306 Ada projects can be compiled, linked, and executed using commands on
307 the Ada menu. All of these commands can be customized via a project
308 file (*note Project files::), but the defaults are sufficient for using
309 the GNAT compiler for simple projects (single files, or several files
310 in a single directory).
311
312 For complex projects, you will want to use `make' or some other
313 build tool; in that case, you will need an Emacs Ada mode project file
314 to tell Emacs about the project directory tree and other settings.
315
316 * Menu:
317
318 * Compile commands::
319 * Compiling Examples::
320 * Compiler errors::
321
322 \1f
323 File: ada-mode.info, Node: Compile commands, Next: Compiling Examples, Prev: Compiling Executing, Up: Compiling Executing
324
325 4.1 Compile commands
326 ====================
327
328 Here are the commands for building an Ada project and running the main
329 program.
330
331 In multi-file projects, there must be one file that is the main
332 program. That is given by the `main' project file variable; it defaults
333 to the current file if not yet set, but is also set by the "set main
334 and build" command.
335
336 `Check file'
337 Compiles the current file in syntax check mode, by running
338 `check_cmd' defined in the current project file. This typically
339 runs faster than full compile mode, speeding up finding and fixing
340 compilation errors.
341
342 This sets `main' only if it has not been set yet.
343
344 `Compile file'
345 Compiles the current file, by running `comp_cmd' from the current
346 project file.
347
348 This does not set `main'.
349
350 `Set main and Build'
351 Sets `main' to the current file, then executes the Build command.
352
353 `Show main'
354 Display `main' in the message buffer.
355
356 `Build'
357 Compiles all obsolete units of the current `main', and links
358 `main', by running `make_cmd' from the current project.
359
360 This sets `main' only if it has not been set yet.
361
362 `Run'
363 Executes the main program in a shell, displayed in a separate Emacs
364 buffer. This runs `run_cmd' from the current project. The
365 execution buffer allows for interactive input/output.
366
367 To modify the run command, in particular to provide or change the
368 command line arguments, type `C-u' before invoking the command.
369
370 This command is not available for a cross-compilation toolchain.
371
372 It is important when using these commands to understand how `main'
373 is used and changed.
374
375 Build runs 'gnatmake' on the main unit. During a typical edit/compile
376 session, this is the only command you need to invoke, which is why it
377 is bound to `C-c C-c'. It will compile all files needed by the main
378 unit, and display compilation errors in any of them.
379
380 Note that Build can be invoked from any Ada buffer; typically you
381 will be fixing errors in files other than the main, but you don't have
382 to switch back to the main to invoke the compiler again.
383
384 Novices and students typically work on single-file Ada projects. In
385 this case, `C-c C-m' will normally be the only command needed; it will
386 build the current file, rather than the last-built main.
387
388 There are three ways to change `main':
389
390 1. Invoke `Ada | Set main and Build', which sets `main' to the
391 current file.
392
393 2. Invoke `Ada | Project | Edit', edit `main' and `main', and click
394 `[save]'
395
396 3. Invoke `Ada | Project | Load', and load a project file that
397 specifies `main'
398
399
400 \1f
401 File: ada-mode.info, Node: Compiling Examples, Next: Compiler errors, Prev: Compile commands, Up: Compiling Executing
402
403 4.2 Compiling Examples
404 ======================
405
406 We present several small projects, and walk thru the process of
407 compiling, linking, and running them.
408
409 The first example illustrates more Ada mode features than the others;
410 you should work thru that example before doing the others.
411
412 All of these examples assume you are using GNAT.
413
414 The source for these examples is available on the Emacs Ada mode
415 website mentioned in *Note Installation::.
416
417 * Menu:
418
419 * No project files:: Just menus
420 * Set compiler options:: A basic Ada mode project file
421 * Set source search path:: Source in multiple directories
422 * Use GNAT project file::
423 * Use multiple GNAT project files::
424 * Use a Makefile::
425
426 \1f
427 File: ada-mode.info, Node: No project files, Next: Set compiler options, Prev: Compiling Examples, Up: Compiling Examples
428
429 4.2.1 No project files
430 ----------------------
431
432 This example uses no project files.
433
434 First, create a directory `Example_1', containing:
435
436 `hello.adb':
437
438 with Ada.Text_IO;
439 procedure Hello
440 is begin
441 Put_Line("Hello from hello.adb");
442 end Hello;
443
444 Yes, this is missing "use Ada.Text_IO;" - we want to demonstrate
445 compiler error handling.
446
447 `hello_2.adb':
448
449 with Hello_Pkg;
450 procedure Hello_2
451 is begin
452 Hello_Pkg.Say_Hello;
453 end Hello_2;
454
455 This file has no errors.
456
457 `hello_pkg.ads':
458
459 package Hello_Pkg is
460 procedure Say_Hello;
461 end Hello_Pkg;
462
463 This file has no errors.
464
465 `hello_pkg.adb':
466
467 with Ada.Text_IO;
468 package Hello_Pkg is
469 procedure Say_Hello
470 is begin
471 Ada.Text_IO.Put_Line ("Hello from hello_pkg.adb");
472 end Say_Hello;
473 end Hello_Pkg;
474
475 Yes, this is missing the keyword `body'; another compiler error
476 example. However, note that the indentation engine parser accepts this
477 code with no errors, making it easier to indent slightly illegal Ada
478 code.
479
480 In buffer `hello.adb', invoke the menu entry `Ada | Build | Check
481 syntax'. You should get a `*compilation*' buffer containing something
482 like (the directory paths will be different):
483
484 -*- mode: compilation; default-directory: "c:/Projects/org.emacs.ada-mode.stephe-1/test/Example_1/" -*-
485 Compilation started at Fri Oct 18 04:23:54
486
487 gnatmake -u -c -gnatc c:/Projects/org.emacs.ada-mode.stephe-1/test/Example_1/hello.adb -cargs
488 gcc -c -Ic:/Projects/org.emacs.ada-mode.stephe-1/test/Example_1/ -gnatc -I- c:/Projects/org.emacs.ada-mode.stephe-1/test/Example_1/hello.adb
489 hello.adb:4:04: "Put_Line" is not visible
490 hello.adb:4:04: non-visible declaration at a-textio.ads:263
491 hello.adb:4:04: non-visible declaration at a-textio.ads:259
492 gnatmake: "c:/Projects/org.emacs.ada-mode.stephe-1/test/Example_1/hello.adb" compilation error
493
494 Compilation exited abnormally with code 4 at Fri Oct 18 04:23:54
495
496 The lines with actual errors (starting with `hello.adb') are
497 highlighted, with the file name in red.
498
499 Now invoke `Ada | Build | Next compilation error'. Or you can click
500 the middle mouse button on the first error line, or use the key binding
501 shown on the menu. The compilation buffer scrolls to put the first
502 error on the top line, and point is put at the place of the error in
503 the `hello.adb' buffer.
504
505 To fix the error, invoke `Ada | Build | Fix compilation error'; this
506 adds "Ada.Text_Io." to the line:
507
508 Ada.Text_Io.Put_Line ("hello from hello.adb");
509
510 Now invoke `Ada | Build | Show main'; this displays `Ada mode main:
511 hello'.
512
513 Now (in buffer `hello.adb'), invoke `Ada | Build | Build'. You are
514 prompted to save the file (if you haven't already). Then the
515 compilation buffer is displayed again, containing:
516
517 -*- mode: compilation; default-directory: "c:/Projects/org.emacs.ada-mode.stephe-1/test/Example_1/" -*-
518 Compilation started at Fri Oct 18 20:39:33
519
520 gnatmake -o hello hello -cargs -bargs -largs
521 gcc -c hello.adb
522 gnatbind -x hello.ali
523 gnatlink hello.ali -o hello.exe
524
525 Compilation finished at Fri Oct 18 20:39:34
526
527 The compilation has succeeded without errors; `hello.exe' now exists
528 in the same directory as `hello.adb'.
529
530 Now invoke `Ada | Build | Run'. The `*compilation*' buffer is
531 displayed, containing
532
533 -*- mode: compilation; default-directory: "c:/Projects/org.emacs.ada-mode.stephe-1/test/Example_1/" -*-
534 Compilation started at Fri Oct 18 20:41:53
535
536 ./hello
537 Hello from hello.adb
538
539 Compilation finished at Fri Oct 18 20:41:53
540
541 That completes the first part of this example.
542
543 Now we will compile a multi-file project. Open the file
544 `hello_2.adb', invoke `Ada | Build | Set main and Build'. This finds an
545 error in `hello_pkg.adb':
546
547 hello_pkg.adb:2:08: keyword "body" expected here [see file name]
548
549 This demonstrates that gnatmake finds the files needed by the main
550 program. However, it cannot find files in a different directory, unless
551 you use an Emacs Ada mode project file or a GNAT project file to
552 specify the other directories; *Note Set source search path::, *note
553 Use GNAT project file::.
554
555 Invoke `Ada | Build | Show main'; this displays `Ada mode main:
556 hello_2'.
557
558 Move to the error with `C-x `', and fix the error by adding `body':
559
560 package body Hello_Pkg is
561
562 Now, while still in `hello_pkg.adb', invoke `Ada | Build | Build'.
563 gnatmake successfully builds `hello_2'. This demonstrates that Emacs
564 has remembered the main file, in the project variable `main', and used
565 it for the Build command.
566
567 Finally, again while in `hello_pkg.adb', invoke `Ada | Build | Run'.
568 The `*compilation*' buffer displays `Hello from hello_pkg.adb'.
569
570 One final point. If you switch back to buffer `hello.adb', and
571 invoke `Ada | Build | Run', `hello_2.exe' will be run. That is because
572 `main' is still set to `hello_2', as you can see when you invoke `Ada |
573 Build | Show main'.
574
575 There are two ways to change `main':
576
577 1. Invoke `Ada | Build | Set main and Build', which sets `main' to
578 the current file.
579
580 2. Invoke `Ada | Build | Set Project ...', and select a project file
581 that specifies `main'.
582
583
584 \1f
585 File: ada-mode.info, Node: Set compiler options, Next: Set source search path, Prev: No project files, Up: Compiling Examples
586
587 4.2.2 Set compiler options
588 --------------------------
589
590 This example illustrates using an Emacs Ada mode project file to set a
591 compiler option.
592
593 If you have files from `Example_1' open in Emacs, you should close
594 them so you don't get confused. Use menu `File | Close (current
595 buffer)'.
596
597 In directory `Example_2', create these files:
598
599 `hello.adb':
600
601 with Ada.Text_IO;
602 procedure Hello
603 is begin
604 Put_Line("Hello from hello.adb");
605 end Hello;
606
607 This is the same as `hello.adb' from `Example_1'. It has two errors;
608 missing "use Ada.Text_IO;", and no space between `Put_Line' and its
609 argument list.
610
611 `hello.adp':
612
613 comp_opt=-gnatyt
614
615 This tells the GNAT compiler to check for token spacing; in
616 particular, there must be a space preceding a parenthesis.
617
618 In buffer `hello.adb', invoke `Ada | Build | Set main and Build'.
619 This finds the project file `hello.adp', uses it to set the compiler
620 options, and builds the project. You should get a `*compilation*'
621 buffer containing something like (the directory paths will be
622 different):
623
624 cd c:/Examples/Example_2/
625 gnatmake -o hello hello -g -cargs -gnatyt -bargs -largs
626 gcc -c -g -gnatyt hello.adb
627 hello.adb:4:04: "Put_Line" is not visible
628 hello.adb:4:04: non-visible declaration at a-textio.ads:264
629 hello.adb:4:04: non-visible declaration at a-textio.ads:260
630 hello.adb:4:12: (style) space required
631 gnatmake: "hello.adb" compilation error
632
633 Compare this to the compiler output in *note No project files::; the
634 gnatmake option `-cargs' has been replaced by `-cargs -gnaty', and an
635 additional error is reported in `hello.adb' on line 4. This shows that
636 `hello.adp' is being used to set the compiler options.
637
638 Fixing the error, linking and running the code proceed as in *note
639 No project files::.
640
641 \1f
642 File: ada-mode.info, Node: Set source search path, Next: Use GNAT project file, Prev: Set compiler options, Up: Compiling Examples
643
644 4.2.3 Set source search path
645 ----------------------------
646
647 In this example, we show how to deal with files in more than one
648 directory, using an Emacs Ada mode project file to set the search path.
649
650 Create the directory `Example_3', containing:
651
652 `hello_pkg.ads':
653
654 package Hello_Pkg is
655 procedure Say_Hello;
656 end Hello_Pkg;
657
658 `hello_pkg.adb':
659
660 with Ada.Text_IO;
661 package Hello_Pkg is
662 procedure Say_Hello
663 is begin
664 Ada.Text_IO.Put_Line ("Hello from hello_pkg.adb");
665 end Say_Hello;
666 end Hello_Pkg;
667
668 These are the same files from example 1; `hello_pkg.adb' has an
669 error on line 2.
670
671 In addition, create a directory `Example_3/Other', containing these
672 files:
673
674 `Other/hello_3.adb':
675
676 with Hello_Pkg;
677 with Ada.Text_IO; use Ada.Text_IO;
678 procedure Hello_3
679 is begin
680 Hello_Pkg.Say_Hello;
681 Put_Line ("From hello_3");
682 end Hello_3;
683
684 There are no errors in this file.
685
686 `Other/other.adp':
687
688 src_dir=..
689
690 Note that there must be no trailing spaces.
691
692 In buffer `hello_3.adb', invoke `Ada | Project files | Find and set
693 project...', and select `Example_3/Other/other.adp'. This tells Emacs
694 Ada mode to stop using the project file from `Example_2', and use the
695 one for `Example_3'. Also note that since this project file is not
696 named `hello_3.adp', it would not be found by default.
697
698 Then, again in `hello_3.adb', invoke `Ada | Set main and Build'. You
699 should get a `*compilation*' buffer containing something like (the
700 directory paths will be different):
701
702 cd c:/Examples/Example_3/Other/
703 gnatmake -o hello_3 hello_3 -g -cargs -I.. -bargs -largs
704 gcc -c -g -I.. hello_3.adb
705 gcc -c -I./ -g -I.. -I- C:\Examples\Example_3\hello_pkg.adb
706 hello_pkg.adb:2:08: keyword "body" expected here [see file name]
707 gnatmake: "C:\Examples\Example_3\hello_pkg.adb" compilation error
708
709 Compare the `-cargs' option to the compiler output in *note Set
710 compiler options::; this shows that `other.adp' is being used to set
711 the compiler options.
712
713 Move to the error with `C-x `'. Ada mode searches the list of
714 directories given by `src_dir' for the file mentioned in the compiler
715 error message.
716
717 Fixing the error, linking and running the code proceed as in *note
718 No project files::.
719
720 \1f
721 File: ada-mode.info, Node: Use GNAT project file, Next: Use multiple GNAT project files, Prev: Set source search path, Up: Compiling Examples
722
723 4.2.4 Use GNAT project file
724 ---------------------------
725
726 In this example, we show how to use a GNAT project file, with no Ada
727 mode project file.
728
729 Create the directory `Example_4', containing:
730
731 `hello_pkg.ads':
732
733 package Hello_Pkg is
734 procedure Say_Hello;
735 end Hello_Pkg;
736
737 `hello_pkg.adb':
738
739 with Ada.Text_IO;
740 package Hello_Pkg is
741 procedure Say_Hello
742 is begin
743 Ada.Text_IO.Put_Line ("Hello from hello_pkg.adb");
744 end Say_Hello;
745 end Hello_Pkg;
746
747 These are the same files from example 1; `hello_pkg.adb' has an
748 error on line 2.
749
750 In addition, create a directory `Example_4/Gnat_Project', containing
751 these files:
752
753 `Gnat_Project/hello_4.adb':
754
755 with Hello_Pkg;
756 with Ada.Text_IO; use Ada.Text_IO;
757 procedure Hello_4
758 is begin
759 Hello_Pkg.Say_Hello;
760 Put_Line ("From hello_4");
761 end Hello_4;
762
763 There are no errors in this file.
764
765 `Gnat_Project/hello_4.gpr':
766
767 project Hello_4 is
768 for Source_Dirs use (".", "..");
769 end Hello_4;
770
771 In buffer `hello_4.adb', invoke `Ada | Project | Load...', and
772 select `Example_4/Gnat_Project/hello_4.gpr'.
773
774 Then, again in `hello_4.adb', invoke `Ada | Set main and Build'. You
775 should get a `*compilation*' buffer containing something like (the
776 directory paths will be different):
777
778 -*- mode: compilation; default-directory: "c:/Projects/org.emacs.ada-mode.stephe-1/test/Example_4/Gnat_Project/" -*-
779 Compilation started at Mon Oct 21 11:28:31
780
781 gnatmake -Pc:/Projects/org.emacs.ada-mode.stephe-1/test/Example_4/Gnat_Project/hello_4.gpr -o hello_4 hello_4 -cargs -I. -Ic:/Projects/org.emacs.ada-mode.stephe-1/test/Example_4/Gnat_Project -Ic:/Projects/org.emacs.ada-mode.stephe-1/test/Example_4 -Ic:/Apps/GNAT-7.1.2/lib/gcc/i686-pc-mingw32/4.7.3/adainclude -bargs -largs
782 gcc -c -I. -Ic:/Projects/org.emacs.ada-mode.stephe-1/test/Example_4/Gnat_Project -Ic:/Projects/org.emacs.ada-mode.stephe-1/test/Example_4 -Ic:/Apps/GNAT-7.1.2/lib/gcc/i686-pc-mingw32/4.7.3/adainclude -I- -gnatA C:\Projects\org.emacs.ada-mode.stephe-1\test\Example_4\hello_pkg.adb
783 hello_pkg.adb:2:08: keyword "body" expected here [see file name]
784 gnatmake: "C:\Projects\org.emacs.ada-mode.stephe-1\test\Example_4\hello_pkg.adb" compilation error
785
786 Compilation exited abnormally with code 4 at Mon Oct 21 11:28:31
787
788 Compare the `gcc' options to the compiler output in *note Set
789 compiler options::; this shows that `hello_4.gpr' is being used to set
790 the compiler options.
791
792 Fixing the error, linking and running the code proceed as in *note
793 No project files::.
794
795 \1f
796 File: ada-mode.info, Node: Use multiple GNAT project files, Next: Use a Makefile, Prev: Use GNAT project file, Up: Compiling Examples
797
798 4.2.5 Use multiple GNAT project files
799 -------------------------------------
800
801 In this example, we show how to use multiple GNAT project files,
802 specifying the GNAT project search path in an Ada mode project file.
803
804 Create the directory `Example_4' as specified in *note Use GNAT
805 project file::.
806
807 Create the directory `Example_5', containing:
808
809 `hello_5.adb':
810
811 with Hello_Pkg;
812 with Ada.Text_IO; use Ada.Text_IO;
813 procedure Hello_5
814 is begin
815 Hello_Pkg.Say_Hello;
816 Put_Line ("From hello_5");
817 end Hello_5;
818
819 There are no errors in this file.
820
821 `hello_5.adp':
822
823 ada_project_path=../Example_4/Gnat_Project
824 gpr_file=hello_5.gpr
825
826 `hello_5.gpr':
827
828 with "hello_4";
829 project Hello_5 is
830 for Source_Dirs use (".");
831 package Compiler is
832 for Default_Switches ("Ada") use ("-g", "-gnatyt");
833 end Compiler;
834 end Hello_5;
835
836 In buffer `hello_5.adb', invoke `Ada | Project | Find and select
837 project...', and select `Example_5/hello_5.adp'. This would also be
838 found by default if no previous project file had been selected.
839
840 Then, again in `hello_5.adb', invoke `Ada | Build | Set main and
841 Build'. You should get a `*compilation*' buffer containing something
842 like (the directory paths will be different):
843
844 -*- mode: compilation; default-directory: "c:/Projects/org.emacs.ada-mode.stephe-1/test/Example_5/" -*-
845 Compilation started at Mon Oct 21 11:32:05
846
847 gnatmake -Pc:/Projects/org.emacs.ada-mode.stephe-1/test/Example_5/hello_5.gpr -o hello_5 hello_5 -cargs -I. -Ic:/Projects/org.emacs.ada-mode.stephe-1/test/Example_5 -Ic:/Projects/org.emacs.ada-mode.stephe-1/test/Example_4/Gnat_Project -Ic:/Projects/org.emacs.ada-mode.stephe-1/test/Example_4 -Ic:/Apps/GNAT-7.1.2/lib/gcc/i686-pc-mingw32/4.7.3/adainclude -bargs -largs
848 gcc -c -I. -Ic:/Projects/org.emacs.ada-mode.stephe-1/test/Example_5 -Ic:/Projects/org.emacs.ada-mode.stephe-1/test/Example_4/Gnat_Project -Ic:/Projects/org.emacs.ada-mode.stephe-1/test/Example_4 -Ic:/Apps/GNAT-7.1.2/lib/gcc/i686-pc-mingw32/4.7.3/adainclude -I- -gnatA C:\Projects\org.emacs.ada-mode.stephe-1\test\Example_4\hello_pkg.adb
849 hello_pkg.adb:2:08: keyword "body" expected here [see file name]
850 gnatmake: "C:\Projects\org.emacs.ada-mode.stephe-1\test\Example_4\hello_pkg.adb" compilation error
851
852 Compilation exited abnormally with code 4 at Mon Oct 21 11:32:05
853
854 Now type `C-x `'. `Example_4/hello_pkg.adb' is shown, demonstrating
855 that `hello_5.gpr' and `hello_4.gpr' are being used to set the
856 compilation search path.
857
858 \1f
859 File: ada-mode.info, Node: Use a Makefile, Prev: Use multiple GNAT project files, Up: Compiling Examples
860
861 4.2.6 Use a Makefile
862 --------------------
863
864 In this example, we show how to use a Makefile to build an Ada project
865 with GNAT, run the result, and clean the build directories.
866
867 Create the directories `Example_4, Example_5' as specified in *note
868 Use GNAT project file::, *note Use multiple GNAT project files::.
869
870 In `Example_5', add the file:
871
872 `Makefile':
873
874 # build and run hello_5 project
875
876 all : build run
877
878 .PHONY : force
879
880 build : force
881 gprbuild -Phello_5.gpr hello_5
882
883 run :
884 ./hello_5
885
886 clean :
887 gnatclean -r -Phello_5
888
889 export GPR_PROJECT_PATH = ../Example_4/Gnat_Project
890
891 # Local Variables:
892 # eval:(ada-parse-prj-file "hello_5.adp")
893 # eval:(ada-select-prj-file "hello_5.adp")
894 # End:
895
896 Close and re-open `Makefile'; the `Local Variables' section sets the
897 project file to `hello_5.adp' when the `Makefile' is opened. You can
898 also use <C-x C-e> to execute the select line after the `Makefile' is
899 opened, to change the project file back to `hello_5.adp'.
900
901 In `Makefile', invoke `Tools | Compile...', and accept the default
902 make command. This runs the `all' target, which builds `hello_5' and
903 runs it.
904
905 \1f
906 File: ada-mode.info, Node: Compiler errors, Prev: Compiling Examples, Up: Compiling Executing
907
908 4.3 Compiler errors
909 ===================
910
911 The `Check syntax' and `Build' commands, or running `make', place
912 compilation errors in a separate buffer named `*compilation*'.
913
914 Each line in this buffer will become active: you can simply click on
915 it with the middle button of the mouse, or move point to it and press
916 <RET>. Emacs will then display the relevant source file and put point
917 on the line and column where the error was found.
918
919 You can also press the `C-x `' key (`next-error'), and Emacs will
920 jump to the first error. If you press that key again, it will move you
921 to the second error, and so on.
922
923 Some error messages also include references to other files. These
924 references are accessed via `C-c `'.
925
926 \1f
927 File: ada-mode.info, Node: Project files, Next: Moving Through Ada Code, Prev: Compiling Executing, Up: Top
928
929 5 Project files
930 ***************
931
932 An Emacs Ada mode project file specifies what directories hold sources
933 for your project, and allows you to customize the compilation commands
934 and other things on a per-project basis.
935
936 The default file extension for Ada mode project files is `*.adp'.
937 You can use a different extension by adding it to
938 `ada-prj-parser-alist'.
939
940 Note that Ada mode project files `*.adp' are different than GNAT
941 compiler project files `*.gpr'. However, Emacs Ada mode can use a GNAT
942 project file to specify the project directories. If no other
943 customization is needed, a GNAT project file can be used without an
944 Emacs Ada mode project file.
945
946 * Menu:
947
948 * Project file overview::
949 * Project file variables::
950
951 \1f
952 File: ada-mode.info, Node: Project file overview, Next: Project file variables, Prev: Project files, Up: Project files
953
954 5.1 Project file overview
955 =========================
956
957 Project files have a simple syntax; they may be edited directly. Each
958 line specifies a project variable name and its value, separated by "="
959 (spaces not allowed):
960 src_dir=/Projects/my_project/src_1
961 src_dir=/Projects/my_project/src_2
962
963 Some variables (like `src_dir') are lists; multiple occurrences are
964 concatenated.
965
966 There must be no space between the variable name and "=", and no
967 trailing spaces.
968
969 The current project file is given by the lisp variable
970 `ada-prj-default-project-file'.
971
972 To set the project file, use the menu command `Ada | Set Project
973 ...', or the elisp functions `ada-parse-prj-file, ada-select-prj-file'.
974 The latter can be added to a Makefile:
975
976 # Local Variables:
977 # eval: (ada-parse-prj-file "ada-mode.prj")
978 # eval: (ada-select-prj-file ada-mode.prj")
979 # End:
980
981 You specify either a GNAT project file or an Emacs Ada mode project
982 file; if the file extension is `.gpr', the file is treated as a GNAT
983 project file. Any other extension is treated as an Emacs Ada mode
984 project file.
985
986 After a project file is parsed, you can make it current again with
987 just `ada-select-prj-file', or by selecting it from the menu.
988
989 \1f
990 File: ada-mode.info, Node: Project file variables, Prev: Project file overview, Up: Project files
991
992 5.2 Project file variables
993 ==========================
994
995 Some project file variables can also be defined in elisp variables.
996
997 To set a project variable that is a list, specify each element of the
998 list on a separate line in the project file.
999
1000 Process environment variables can be referenced using the normal
1001 `$var' syntax.
1002
1003 Most project variables have defaults that can be changed by setting
1004 elisp variables; the table below identifies the lisp variable for each
1005 project variable. Elisp variables corresponding to project variables
1006 that are lists are elisp lists.
1007
1008 In general, project variables are evaluated when referenced in Emacs
1009 Ada mode commands. Relative file paths are expanded to absolute
1010 relative to the directory containing the project file.
1011
1012 Ada mode defines some project variables; others are defined by the
1013 compiler.
1014
1015 Here is the list of variables valid for all compilers. In the default
1016 values, the current directory `"."' is the directory containing the
1017 project file.
1018
1019 `ada_compiler' [default: `ada-compiler, gnat']
1020 Ada compiler for this project. It must occur in the project file
1021 before any compiler-specific project variable.
1022
1023 `auto_case' [default: `ada-auto-case, t']
1024 Non-nil means automatically change case of preceding word while
1025 typing.
1026
1027 `case_keyword' [default: `ada-case-keyword, downcase-word']
1028 Function to call to adjust the case of an Ada keywords.
1029
1030 `case_strict' [default: `ada-case-strict, t']
1031 If non-nil, force Mixed_Case for identifiers. Otherwise, allow
1032 UPPERCASE for identifiers.
1033
1034 `casing' [default: `ada-case-exception-file, nil']
1035 List of files containing casing exceptions. *Note Automatic
1036 casing::.
1037
1038 `src_dir' [default: `"."']
1039 A list of directories to search for source files.
1040
1041 `xref_tool' [default: `ada-xref-tool, gnat-xref']
1042 Cross reference tool for this project.
1043
1044
1045 The following variables are valid with the GNAT compiler:
1046
1047 `ada_project_path' [default: `""']
1048 A list of directories to search for GNAT project files.
1049
1050 If set, the `ADA_PROJECT_PATH' process environment variable is set
1051 to this value in the child process that runs GNAT tools. If not
1052 set, `ADA_PROJECT_PATH' in the child process is inherited from the
1053 Emacs process.
1054
1055 If you have the `ADA_PROJECT_PATH' environment variable set in the
1056 Emacs process correctly for all of your projects, you do not need
1057 to set this project variable.
1058
1059 `gpr_file' [default: `""']
1060 The GNAT project file.
1061
1062 If set, the source and project directories specified in the GNAT
1063 project file are appended to `src_dir' and `ada_project_path'.
1064 This allows specifying Ada source directories with a GNAT project
1065 file, and other source directories with the Emacs project file.
1066
1067
1068 \1f
1069 File: ada-mode.info, Node: Moving Through Ada Code, Next: Identifier completion, Prev: Project files, Up: Top
1070
1071 6 Moving Through Ada Code
1072 *************************
1073
1074 There are several commands to navigate through Ada code. All these
1075 functions are available through the Ada menu and keybindings.
1076
1077 Some of these commands rely on facilities provided by the compiler;
1078 the standard Emacs Ada mode only supports the GNAT compiler, but others
1079 can be added.
1080
1081 `C-c C-d'
1082 Move from any use of an identifier to its declaration, for from a
1083 declaration to its body.
1084
1085 `C-c M-d'
1086 Move from a child type declaration to the parent type declaration.
1087
1088 `C-c C-n'
1089 Move to the next keyword in the current statement.
1090
1091 For example, if point is on `if', move to `then'.
1092
1093 `C-c C-p'
1094 Move to the previous keyword in the current statement.
1095
1096 For example, if point is on `then', move to `if'.
1097
1098 `C-c C-o'
1099 Switch between corresponding spec and body. There are several
1100 special cases:
1101 * If the region is active, it is assumed to contain an Ada
1102 package name; position point on the corresponding package
1103 declaration.
1104
1105 * If point is in the start line of a top level child package
1106 declaration (but not package body), or a child subprogram
1107 spec or body, position point on the corresponding parent
1108 package declaration.
1109
1110 * If point is in the start line of a top level separate
1111 body, position point on the corresponding separate stub
1112 declaration.
1113
1114 * If point is in a subprogram, position point on the
1115 corresponding declaration or body in the other file.
1116
1117
1118 `C-c C-r'
1119 Show all references to the identifier surrounding point. Use `C-x
1120 `' (`next-error') to visit each reference (as for compilation
1121 errors).
1122
1123 `C-c C-x'
1124 Show all declarations that override the primitive procedure at
1125 point. Use `C-x `' (`next-error') to visit each reference (as for
1126 compilation errors).
1127
1128 `C-u SPACE'
1129 Jump back to the previous location.
1130
1131
1132 \1f
1133 File: ada-mode.info, Node: Identifier completion, Next: Indentation, Prev: Moving Through Ada Code, Up: Top
1134
1135 7 Identifier completion
1136 ***********************
1137
1138 Emacs provides a general way of completing identifiers: `M-/' (bound to
1139 `dabbrev-expand'). This is an easy way to type faster: you just have to
1140 type the first few letters of an identifier, and then loop through all
1141 the possible completions.
1142
1143 `M-/' works by parsing all open Ada files for possible completions.
1144
1145 For instance, if the words `my_identifier' and `my_subprogram' are
1146 the only words starting with `my' in any of the open Ada files, then
1147 you will have this scenario:
1148
1149 You type: myM-/
1150 Emacs inserts: `my_identifier'
1151 If you press M-/ once again, Emacs replaces `my_identifier' with
1152 `my_subprogram'.
1153 Pressing M-/ once more will bring you back to `my_identifier'.
1154
1155 This is a very fast way to do completion, and the casing of words
1156 will also be respected.
1157
1158 \1f
1159 File: ada-mode.info, Node: Indentation, Next: Statement skeletons, Prev: Identifier completion, Up: Top
1160
1161 8 Indentation
1162 *************
1163
1164 Ada mode comes with a full set of rules for automatic indentation. You
1165 can also configure the indentation, via the following variables:
1166
1167 `ada-indent' (default value: 3)
1168 Number of columns for default indentation.
1169
1170 `ada-indent-broken' (default value: 2)
1171 Number of columns to indent the continuation of a broken line.
1172
1173 `ada-indent-comment-col-0' (default value: nil)
1174 If non-nil, comments currently starting in column 0 are left in
1175 column 0. Otherwise, they are indented with previous comments or
1176 code.
1177
1178 `ada-indent-label' (default value: -3)
1179 Number of columns to indent a label.
1180
1181 `ada-indent-record-rel-type' (default value: 3)
1182 Indentation for `record' relative to `type' or `use'.
1183
1184 `ada-indent-renames' (default value: 2)
1185 Indentation for `renames' relative to the matching subprogram
1186 keyword.
1187
1188 If the subprogram has parameters then if `ada-indent-renames' is
1189 zero or less the indentation is abs `ada-indent-renames' relative
1190 to the open parenthesis; if `ada-indent-renames' is one or more
1191 the indentation is relative to the line containing the keyword.
1192
1193 If the subprogram has no parameters then `ada-indent-broken' the
1194 indentation is relative to the indentation of the line containing
1195 the keyword.
1196
1197 `ada-indent-return' (default value: 0)
1198 Indentation for `return' relative to the matching `function'.
1199
1200 If the function has parameters, then if `ada-indent-return' is
1201 zero or less the indentation is abs `ada-indent-return' relative
1202 to the open parenthesis; if `ada-indent-return' is one or more,
1203 indentation is relative to line containing `function'.
1204
1205 If the function has no parameters, `ada-indent-broken' is used
1206 relative to line containing `function'.
1207
1208 `ada-indent-use' (default value: ada-indent-broken)
1209 Indentation for the lines in a `use' statement.
1210
1211 `ada-indent-when' (default value: 3)
1212 Indentation for `when' relative to `exception', `case', or `or' in
1213 `select'.
1214
1215 `ada-indent-with' (default value: ada-indent-broken)
1216 Indentation for the lines in a `with' context clause.
1217
1218
1219 The following keys indent portions of the text:
1220 `RET'
1221 Insert and indent a new line.
1222
1223 `TAB'
1224 Indent the current line, or the current region.
1225
1226 `C-c TAB'
1227 Indent the current statement or declaration.
1228
1229
1230 The indentation algorithm relies on a grammar parser to identify the
1231 syntactic role for keywords and other words in the code. If the code is
1232 accepted by the parser, the indentation is correct. If the code is not
1233 accepted (because it is partially complete during editing), the
1234 indentation engine falls back to the trivial algorithm of indenting
1235 each new line the same as the previous line.
1236
1237 Once enough new text has been entered to make the code acceptable to
1238 the parser, the statement or declaration is properly indented.
1239
1240 For example, if you are entering this code:
1241
1242 if A then
1243 B;
1244 end if;
1245
1246 when you type `RET B', `B' is indented to the same column as `if'.
1247 Then when you type the final `;', all three lines are indented, putting
1248 `B' where it belongs.
1249
1250 To be more user friendly, the parser accepts a superset of the Ada
1251 grammer. For example, the parser accepts this code for an `if'
1252 statement:
1253
1254 if then
1255 end if;
1256
1257 In general, any sequence of statements, and many expressions, may be
1258 omitted.
1259
1260 One way to easily insert empty statements like this is using *note
1261 Statement skeletons::.
1262
1263 \1f
1264 File: ada-mode.info, Node: Statement skeletons, Next: Aligning code, Prev: Indentation, Up: Top
1265
1266 9 Statement skeletons
1267 *********************
1268
1269 `C-c C-e' expands the previous one or two words into a statment
1270 skeleton. For example, `if C-c C-e' expands to:
1271
1272 if then
1273 elsif then
1274 else
1275 end if;
1276
1277 All skeleton expansions are accepted by the indentation parser, so
1278 this is a convenient way to insert statements with correct indentation.
1279
1280 For named statements (packages, loops, etc), the name is taken from
1281 the word before point, and the name of statement from the word before
1282 that. Some expansions prompt for more information, such as whether a
1283 spec or body is desired. For example, `package A_Package C-c C-e' first
1284 prompts for "body" or "spec". If "spec" is selected, the following code
1285 is inserted:
1286
1287 package A_Package is
1288 private
1289 end A_Package;
1290
1291 Named blocks work similarly: `declare A_Block C-c C-e' expands
1292 (without prompting) to:
1293
1294 A_Block:
1295 declare
1296 begin
1297 exception
1298 end A_Block;
1299
1300 Note that the order of the keyword `declare' and the name `A_Block'
1301 are reversed in the expansion; this may take some getting used to.
1302
1303 \1f
1304 File: ada-mode.info, Node: Aligning code, Next: Automatic casing, Prev: Statement skeletons, Up: Top
1305
1306 10 Aligning code
1307 ****************
1308
1309 Aligning code adds space in each line so that similar parts of
1310 successive lines are aligned vertically. For example, a sequence of
1311 declarations:
1312
1313 A : Integer;
1314 Another : Float := 1.0;
1315 More : Integer := 2;
1316
1317 changes to this when aligned:
1318
1319 A : Integer;
1320 Another : Float := 1.0;
1321 More : Integer := 2;
1322
1323 Alignment is invoked by `C-c C-a', which aligns the sequence of
1324 statements surrounding point, or within the selected region.
1325
1326 Parameter lists are also aligned:
1327
1328 procedure Foo
1329 (A : in Integer;
1330 Another : out Float := 1.0;
1331 More : in out Integer := 2);
1332
1333 is aligned to:
1334
1335 procedure Foo
1336 (A : in Integer;
1337 Another : out Float := 1.0;
1338 More : in out Integer := 2);
1339
1340 \1f
1341 File: ada-mode.info, Node: Automatic casing, Next: Comment Handling, Prev: Aligning code, Up: Top
1342
1343 11 Automatic casing
1344 *******************
1345
1346 Casing of identifiers, attributes and keywords is automatically
1347 performed while typing when the variable `ada-auto-case' is non-nil.
1348 Every time you type a word separator, the previous word is
1349 automatically cased.
1350
1351 You can customize the automatic casing with the following variables:
1352
1353 `ada-case-keyword'
1354 Value must be one of:
1355 `downcase-word'
1356 Ada keywords will be lowercase.
1357
1358 `upcase-word'
1359 Ada keywords will be uppercase.
1360
1361 `ada-case-strict'
1362 If non-nil, all identifiers are forced to `Mixed_Case'; first
1363 letter, and letter following "_" are uppercase; rest are lowercase.
1364
1365 If nil, the mixed case characters in identifiers are forced to
1366 upper case, but the other characters are not modified. That allows
1367 typing all uppercase identifiers without defining an exception.
1368
1369 You can define exceptions to these rules, in files specified by the
1370 variable `ada-case-exception-file'. Each line in a case exception file
1371 specifies the casing of one word or word fragment. If an exception is
1372 defined in multiple files, the first occurrence is used.
1373
1374 If the word starts with an asterisk (`*'), it defines the casing of
1375 a word fragemnt (or "substring"); part of a word between two
1376 underscores or word boundary.
1377
1378 For example:
1379
1380 DOD
1381 *IO
1382 GNAT
1383
1384 The word fragment `*IO' applies to any word containing "_io";
1385 `Text_IO', `Hardware_IO', etc.
1386
1387 There are two ways to add new items to this file: you can simply edit
1388 it as you would edit any text file. Or you can position point on the
1389 word you want to add, and select menu `Ada | Casing | Create full
1390 exception' (`C-c C-y', `ada-case-create-exception') or `Ada | Casing |
1391 Create partial exception' (`C-c C-M-y'). The word will be added to the
1392 current list of exceptions and to the file.
1393
1394 It is sometimes useful to have multiple exception files. For
1395 example, one could be the standard Ada acronyms, the second some
1396 company specific exceptions, and the last one some project specific
1397 exceptions. If you set up the variable `ada-case-exception-file' as a
1398 list of files, each of them will be parsed and used in your emacs
1399 session. When you create a new exception, you are prompted for the file
1400 to save it in.
1401
1402 Other keys and menu entries are defined:
1403
1404 `C-c C-w'
1405 Adjust case of the word at point. With prefix arg, adjust case
1406 even if in comment. Normally, comments are not affected by case
1407 adjust.
1408
1409 `Ada | Casing | Adjust case region'
1410 Adjust case in the active region.
1411
1412 `Ada | Casing | Adjust case buffer'
1413 Adjust case in the active buffer.
1414
1415
1416 \1f
1417 File: ada-mode.info, Node: Comment Handling, Next: Key summary, Prev: Automatic casing, Up: Top
1418
1419 12 Comment Handling
1420 *******************
1421
1422 By default, comment lines get indented like Ada code. There are a few
1423 additional functions to handle comments:
1424
1425 `M-;'
1426 If the region is active, comment or uncomment it.
1427
1428 If the current line is empty, start a comment.
1429
1430 Otherwise, add a comment at the end of the line, in a column given
1431 by `comment-column'.
1432
1433 `M-q'
1434 Fill the current comment paragraph.
1435
1436 \1f
1437 File: ada-mode.info, Node: Key summary, Next: Developer overview, Prev: Comment Handling, Up: Top
1438
1439 13 Key summary
1440 **************
1441
1442 `M-/'
1443 *Note Identifier completion::. Complete the word before point;
1444 repeat to cycle thru possible completions.
1445
1446 `M-;'
1447 *Note Comment Handling::. If the region is active, comment or
1448 uncomment it.
1449
1450 `RET'
1451 *Note Indentation::. Insert and indent a new line.
1452
1453 `TAB'
1454 *Note Indentation::. Indent the current line, or the current
1455 region.
1456
1457 `C-c TAB'
1458 *Note Indentation::. Indent the current statement or declaration.
1459
1460 `C-c `'
1461 *Note Compiler errors::. Move to the location of the secondary
1462 reference in the current compilation error.
1463
1464 `C-c C-a'
1465 *Note Aligning code::. Align code.
1466
1467 `C-c C-d'
1468 *Note Moving Through Ada Code::. Move from any use of an
1469 identifier to its declaration, for from a declaration to its body.
1470
1471 `C-c M-d'
1472 *Note Moving Through Ada Code::. Move from a child type
1473 declaration to the parent type declaration.
1474
1475 `C-c C-e'
1476 *Note Statement skeletons::. Expand previous one or two words
1477 into a statement or declaration skeleton.
1478
1479 `C-c C-n'
1480 *Note Moving Through Ada Code::. Move to the next keyword in the
1481 current statement.
1482
1483 `C-c C-o'
1484 *Note Moving Through Ada Code::. Switch between corresponding
1485 spec and body, or find other spec.
1486
1487 `C-c C-p'
1488 *Note Moving Through Ada Code::. Move to the previous keyword in
1489 the current statement.
1490
1491 `C-c C-r'
1492 *Note Moving Through Ada Code::. Show all references to the
1493 identifier surrounding point.
1494
1495 `C-c C-w'
1496 *Note Automatic casing::. Adjust case of the word at point. With
1497 prefix arg, adjust case even if in comment.
1498
1499 `C-c C-x'
1500 *Note Moving Through Ada Code::. Show all declarations that
1501 override the primitive procedure at point.
1502
1503 `C-c C-y'
1504 *Note Automatic casing::. Create case exception.
1505
1506 `C-x `'
1507 *Note Compiler errors::. Move to the location of the next
1508 compilation error or show result.
1509
1510 `M-q'
1511 *Note Comment Handling::. Fill the current comment paragraph.
1512
1513
1514 \1f
1515 File: ada-mode.info, Node: Developer overview, Next: GNU Free Documentation License, Prev: Key summary, Up: Top
1516
1517 14 Developer overview
1518 *********************
1519
1520 If you'd like to contribute to Ada mode, or just understand the
1521 sources, here's an overview.
1522
1523 * Menu:
1524
1525 * Directory structure::
1526 * Package organization::
1527 * OpenToken::
1528
1529 \1f
1530 File: ada-mode.info, Node: Directory structure, Next: Package organization, Prev: Developer overview, Up: Developer overview
1531
1532 14.1 Directory structure
1533 ========================
1534
1535 `org.emacs.ada-mode.stephe-1'
1536 Main source.
1537
1538 File extensions:
1539 `*.el'
1540 Elisp files; main code.
1541
1542 `*.elc'
1543 Byte-compiled elisp files, not in the distribution. Generated
1544 by the Makefile target `byte-compile'.
1545
1546 Compiling the parse tables (`*-wy.el') speeds up loading them
1547 significantly. Compiling other files speeds up parsing, but
1548 not noticeably.
1549
1550 One reason to byte-compile files is to find errors; the byte
1551 compiler reports undefined variables, wrong argument counts,
1552 etc.
1553
1554 `*-wy.el'
1555 Parse tables, generated from the corresponding grammar `*.wy'
1556 by the OpenToken tool `wisi-generate.exe'. These are in the
1557 tarball distribution and the monotone so users and Elisp
1558 developers don't have to install OpenToken.
1559
1560 `*-wy.output'
1561 Diagnostic output from `wisi-generate.exe', useful for tracing
1562 parses while debugging a grammar issue. Not in the tarball
1563 distribution or the monotone repository.
1564
1565 `*.wy'
1566 Grammar files, specifying the language to be parsed. The
1567 syntax for these grammar files is similar to that for bison
1568 and wisent, but not the same; see the OpenToken documentation
1569 for more info.
1570
1571 The wisi parser (in `wisi-parse.el') is a generalized LALR
1572 parser, so it tolerates some conflicts and ambiguities. This
1573 makes the grammars easier to write, and in particular makes
1574 it possible to let the Ada grammar closely match Annex P of
1575 the Ada Language Reference Manual (the syntax summary).
1576
1577 `*.texi'
1578 Texinfo source for the user guides.
1579
1580 `*.html'
1581 Generated user guide in HTML format.
1582
1583 `*.info'
1584 Generated user guide in Emacs info format.
1585
1586
1587 `build'
1588 Makefiles for byte-compiling, running tests, making zips.
1589
1590 `build/wisi'
1591 Makefiles for building and testing with the wisi-based parser.
1592 Separate from `build', because there used to be a SMIE-based
1593 parser, and there might be another one someday.
1594
1595 The emacs used to byte-compile and run tests is given by the 'make'
1596 variable EMACS_EXE, which defaults to 'emacs'; it can be
1597 overridden on the make command line or by an environment variable.
1598
1599 `test'
1600 All tests for Ada mode, gpr mode, parser.
1601
1602 Each test is run in a separate invocation of Emacs, so it is
1603 completely independent of all other tests.
1604
1605 The tests are driven by the elisp code in `build/*.el'.
1606
1607 In general, the Ada mode tests open the file, execute test actions,
1608 re-indent, and re-captialize the entire file. The result is diffed
1609 with the original, and must match.
1610
1611 The test actions are defined by comments with the prefix
1612 `--EMACSCMD:'; they are elisp forms that invoke Ada mode
1613 functions. This is used to test navigation features and other
1614 parser effects.
1615
1616 `test/Example_*'
1617 Starting files for examples in user guide.
1618
1619 `test/gpr'
1620 Tests for gpr mode.
1621
1622 `test/subdir'
1623 More tests; allows testing path search features.
1624
1625 `test/wisi'
1626 Tests of the elisp wisi grammar compiler and parser.
1627
1628 \1f
1629 File: ada-mode.info, Node: Package organization, Next: OpenToken, Prev: Directory structure, Up: Developer overview
1630
1631 14.2 Package organization
1632 =========================
1633
1634 * Menu:
1635
1636 * Ada mode::
1637 * gpr mode::
1638 * GNAT core::
1639 * Wisi::
1640
1641 \1f
1642 File: ada-mode.info, Node: Ada mode, Next: gpr mode, Prev: Package organization, Up: Package organization
1643
1644 14.2.1 Ada mode
1645 ---------------
1646
1647 Ada mode consists of all files with `ada-' prefix in the file name.
1648
1649 `ada-mode.el'
1650 The main file, implementing the keymap, menu, and top level
1651 functionality.
1652
1653 It allows for different backend implementations for compiling,
1654 cross-referencing, and indenting. The functions for each of these
1655 backends dispatch thru global variables that are set by Emacs Ada
1656 mode project files. They default to the GNAT compiler, the
1657 gnatxref cross reference tool, and the ada-wisi indentation engine.
1658
1659 `ada-build.el'
1660 Provides functions for compiling Ada files without a Makefile (or
1661 similar tool).
1662
1663 `ada-fix-error.el'
1664 Provides an interface to utilities for automatically fixing errors
1665 reported by the compiler. It dispatches to a compiler-specific
1666 backend.
1667
1668 `ada-gnat-compile.el'
1669 Implements the Ada mode compiler functions for the GNAT compiler.
1670
1671 `ada-gnat-xref.el'
1672 Implements the Ada mode cross reference functions for the GNAT
1673 compiler.
1674
1675 `ada-grammar.*'
1676 The Ada language grammar, and files generated from it by the
1677 OpenToken tool `wisi-generate.exe'.
1678
1679 `ada-indent-user-options.el'
1680 All user-settable options for the Ada indentation engine.
1681
1682 `ada-mode-compat-23.4.el'
1683 A start on defining functions used by Ada mode but not in Emacs
1684 23.4.
1685
1686 Emacs Ada mode is written for Emacs 24.3. Emacs version 23.4 is
1687 partially supported. Earlier versions of Emacs are not supported.
1688
1689 `ada-mode.texi'
1690 The Ada mode user guide source and compiled versions.
1691
1692 `ada-skel.el'
1693 Skeletons for expansion of Ada syntax (*note Statement
1694 skeletons::). Extends the Emacs skeleton functions with "tokens",
1695 inspired by the lamented Else package (which was inspired by DEC
1696 LSE).
1697
1698 `ada-wisi-opentoken.el'
1699 Indentation functions useful when editing OpenToken code; an
1700 example of extending the Ada mode indentation engine for special
1701 circumstances.
1702
1703 `ada-wisi.el'
1704 Implements the Ada mode indentation functions for the wisi
1705 indentation engine backend.
1706
1707
1708 \1f
1709 File: ada-mode.info, Node: gpr mode, Next: GNAT core, Prev: Ada mode, Up: Package organization
1710
1711 14.2.2 gpr mode
1712 ---------------
1713
1714 gpr mode consists of all files with `gpr-' prefix in the file name. The
1715 functions in each file are similar to the similarly-named Ada mode
1716 files.
1717
1718 \1f
1719 File: ada-mode.info, Node: GNAT core, Next: Wisi, Prev: gpr mode, Up: Package organization
1720
1721 14.2.3 GNAT core
1722 ----------------
1723
1724 `gnat-core.el'
1725 GNAT is actually a multi-language tool; it builds on top of the
1726 multi-language gcc.
1727
1728 `gnat-core.el' is a start at a language-agnostic interface to the
1729 GNAT tools. It was first factored out from `ada-gnat.el' and
1730 `ada-mode.el' to support the multi-language `gnat-inspect.el',
1731 which is still experimental.
1732
1733 More code currently in `ada-mode.el' could be migrated to
1734 `gnat-core.el', in particular the project file support.
1735
1736 `gnat-inspect.el'
1737 Provides an experimental interface to the experimental
1738 multi-language cross-reference tool `gnatinspect' from AdaCore,
1739 which will supercede `gnatxref'.
1740
1741 Implements the Ada mode cross-reference functions for the
1742 `gnatinspect' backend, and a minor mode providing similar
1743 functions for C++.
1744
1745
1746 \1f
1747 File: ada-mode.info, Node: Wisi, Prev: GNAT core, Up: Package organization
1748
1749 14.2.4 Wisi
1750 -----------
1751
1752 The "wisi" parser. "wisi" used to be an acronym, but now it's just a
1753 name.
1754
1755 `wisi.el'
1756 Implements the lexer, the main parser driver, parser actions that
1757 cache parser information in text properties, utilities for
1758 indenting and navigating using the cached information, and general
1759 setup.
1760
1761 `wisi-compile.el'
1762 Implements the parse table compiler. `wisi-generate.exe' processes
1763 the grammar source `*.wy' into an elisp source representation of a
1764 parse table `*-wy.el'. That is compiled into an internal structure
1765 containing the state transitions and executable actions. The
1766 actions can be any elisp form; the intent is that they be calls to
1767 the action functions provided by `wisi.el'. `wisi-compile.el' uses
1768 some features provided by `semantic'.
1769
1770 `wisi-parse.el'
1771 Implements the generalized LALR parser.
1772
1773 \1f
1774 File: ada-mode.info, Node: OpenToken, Prev: Package organization, Up: Developer overview
1775
1776 14.3 OpenToken
1777 ==============
1778
1779 Ada mode uses the OpenToken tool `wisi-generate.exe' to process the
1780 grammar sources into elisp parse tables. See
1781 `http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html' for
1782 current information about which version of OpenToken is required, and
1783 how to get it.
1784
1785 The Makefile variable `WISI_OPENTOKEN' gives the path to the build
1786 directory for OpenToken; you probably need to override it with an
1787 external environment variable or on the `make' command line.
1788
1789 \1f
1790 File: ada-mode.info, Node: GNU Free Documentation License, Next: Index, Prev: Developer overview, Up: Top
1791
1792 Appendix A GNU Free Documentation License
1793 *****************************************
1794
1795 Version 1.3, 3 November 2008
1796
1797 Copyright (C) 2000, 2001, 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
1798 `http://fsf.org/'
1799
1800 Everyone is permitted to copy and distribute verbatim copies
1801 of this license document, but changing it is not allowed.
1802
1803 0. PREAMBLE
1804
1805 The purpose of this License is to make a manual, textbook, or other
1806 functional and useful document "free" in the sense of freedom: to
1807 assure everyone the effective freedom to copy and redistribute it,
1808 with or without modifying it, either commercially or
1809 noncommercially. Secondarily, this License preserves for the
1810 author and publisher a way to get credit for their work, while not
1811 being considered responsible for modifications made by others.
1812
1813 This License is a kind of "copyleft", which means that derivative
1814 works of the document must themselves be free in the same sense.
1815 It complements the GNU General Public License, which is a copyleft
1816 license designed for free software.
1817
1818 We have designed this License in order to use it for manuals for
1819 free software, because free software needs free documentation: a
1820 free program should come with manuals providing the same freedoms
1821 that the software does. But this License is not limited to
1822 software manuals; it can be used for any textual work, regardless
1823 of subject matter or whether it is published as a printed book.
1824 We recommend this License principally for works whose purpose is
1825 instruction or reference.
1826
1827 1. APPLICABILITY AND DEFINITIONS
1828
1829 This License applies to any manual or other work, in any medium,
1830 that contains a notice placed by the copyright holder saying it
1831 can be distributed under the terms of this License. Such a notice
1832 grants a world-wide, royalty-free license, unlimited in duration,
1833 to use that work under the conditions stated herein. The
1834 "Document", below, refers to any such manual or work. Any member
1835 of the public is a licensee, and is addressed as "you". You
1836 accept the license if you copy, modify or distribute the work in a
1837 way requiring permission under copyright law.
1838
1839 A "Modified Version" of the Document means any work containing the
1840 Document or a portion of it, either copied verbatim, or with
1841 modifications and/or translated into another language.
1842
1843 A "Secondary Section" is a named appendix or a front-matter section
1844 of the Document that deals exclusively with the relationship of the
1845 publishers or authors of the Document to the Document's overall
1846 subject (or to related matters) and contains nothing that could
1847 fall directly within that overall subject. (Thus, if the Document
1848 is in part a textbook of mathematics, a Secondary Section may not
1849 explain any mathematics.) The relationship could be a matter of
1850 historical connection with the subject or with related matters, or
1851 of legal, commercial, philosophical, ethical or political position
1852 regarding them.
1853
1854 The "Invariant Sections" are certain Secondary Sections whose
1855 titles are designated, as being those of Invariant Sections, in
1856 the notice that says that the Document is released under this
1857 License. If a section does not fit the above definition of
1858 Secondary then it is not allowed to be designated as Invariant.
1859 The Document may contain zero Invariant Sections. If the Document
1860 does not identify any Invariant Sections then there are none.
1861
1862 The "Cover Texts" are certain short passages of text that are
1863 listed, as Front-Cover Texts or Back-Cover Texts, in the notice
1864 that says that the Document is released under this License. A
1865 Front-Cover Text may be at most 5 words, and a Back-Cover Text may
1866 be at most 25 words.
1867
1868 A "Transparent" copy of the Document means a machine-readable copy,
1869 represented in a format whose specification is available to the
1870 general public, that is suitable for revising the document
1871 straightforwardly with generic text editors or (for images
1872 composed of pixels) generic paint programs or (for drawings) some
1873 widely available drawing editor, and that is suitable for input to
1874 text formatters or for automatic translation to a variety of
1875 formats suitable for input to text formatters. A copy made in an
1876 otherwise Transparent file format whose markup, or absence of
1877 markup, has been arranged to thwart or discourage subsequent
1878 modification by readers is not Transparent. An image format is
1879 not Transparent if used for any substantial amount of text. A
1880 copy that is not "Transparent" is called "Opaque".
1881
1882 Examples of suitable formats for Transparent copies include plain
1883 ASCII without markup, Texinfo input format, LaTeX input format,
1884 SGML or XML using a publicly available DTD, and
1885 standard-conforming simple HTML, PostScript or PDF designed for
1886 human modification. Examples of transparent image formats include
1887 PNG, XCF and JPG. Opaque formats include proprietary formats that
1888 can be read and edited only by proprietary word processors, SGML or
1889 XML for which the DTD and/or processing tools are not generally
1890 available, and the machine-generated HTML, PostScript or PDF
1891 produced by some word processors for output purposes only.
1892
1893 The "Title Page" means, for a printed book, the title page itself,
1894 plus such following pages as are needed to hold, legibly, the
1895 material this License requires to appear in the title page. For
1896 works in formats which do not have any title page as such, "Title
1897 Page" means the text near the most prominent appearance of the
1898 work's title, preceding the beginning of the body of the text.
1899
1900 The "publisher" means any person or entity that distributes copies
1901 of the Document to the public.
1902
1903 A section "Entitled XYZ" means a named subunit of the Document
1904 whose title either is precisely XYZ or contains XYZ in parentheses
1905 following text that translates XYZ in another language. (Here XYZ
1906 stands for a specific section name mentioned below, such as
1907 "Acknowledgements", "Dedications", "Endorsements", or "History".)
1908 To "Preserve the Title" of such a section when you modify the
1909 Document means that it remains a section "Entitled XYZ" according
1910 to this definition.
1911
1912 The Document may include Warranty Disclaimers next to the notice
1913 which states that this License applies to the Document. These
1914 Warranty Disclaimers are considered to be included by reference in
1915 this License, but only as regards disclaiming warranties: any other
1916 implication that these Warranty Disclaimers may have is void and
1917 has no effect on the meaning of this License.
1918
1919 2. VERBATIM COPYING
1920
1921 You may copy and distribute the Document in any medium, either
1922 commercially or noncommercially, provided that this License, the
1923 copyright notices, and the license notice saying this License
1924 applies to the Document are reproduced in all copies, and that you
1925 add no other conditions whatsoever to those of this License. You
1926 may not use technical measures to obstruct or control the reading
1927 or further copying of the copies you make or distribute. However,
1928 you may accept compensation in exchange for copies. If you
1929 distribute a large enough number of copies you must also follow
1930 the conditions in section 3.
1931
1932 You may also lend copies, under the same conditions stated above,
1933 and you may publicly display copies.
1934
1935 3. COPYING IN QUANTITY
1936
1937 If you publish printed copies (or copies in media that commonly
1938 have printed covers) of the Document, numbering more than 100, and
1939 the Document's license notice requires Cover Texts, you must
1940 enclose the copies in covers that carry, clearly and legibly, all
1941 these Cover Texts: Front-Cover Texts on the front cover, and
1942 Back-Cover Texts on the back cover. Both covers must also clearly
1943 and legibly identify you as the publisher of these copies. The
1944 front cover must present the full title with all words of the
1945 title equally prominent and visible. You may add other material
1946 on the covers in addition. Copying with changes limited to the
1947 covers, as long as they preserve the title of the Document and
1948 satisfy these conditions, can be treated as verbatim copying in
1949 other respects.
1950
1951 If the required texts for either cover are too voluminous to fit
1952 legibly, you should put the first ones listed (as many as fit
1953 reasonably) on the actual cover, and continue the rest onto
1954 adjacent pages.
1955
1956 If you publish or distribute Opaque copies of the Document
1957 numbering more than 100, you must either include a
1958 machine-readable Transparent copy along with each Opaque copy, or
1959 state in or with each Opaque copy a computer-network location from
1960 which the general network-using public has access to download
1961 using public-standard network protocols a complete Transparent
1962 copy of the Document, free of added material. If you use the
1963 latter option, you must take reasonably prudent steps, when you
1964 begin distribution of Opaque copies in quantity, to ensure that
1965 this Transparent copy will remain thus accessible at the stated
1966 location until at least one year after the last time you
1967 distribute an Opaque copy (directly or through your agents or
1968 retailers) of that edition to the public.
1969
1970 It is requested, but not required, that you contact the authors of
1971 the Document well before redistributing any large number of
1972 copies, to give them a chance to provide you with an updated
1973 version of the Document.
1974
1975 4. MODIFICATIONS
1976
1977 You may copy and distribute a Modified Version of the Document
1978 under the conditions of sections 2 and 3 above, provided that you
1979 release the Modified Version under precisely this License, with
1980 the Modified Version filling the role of the Document, thus
1981 licensing distribution and modification of the Modified Version to
1982 whoever possesses a copy of it. In addition, you must do these
1983 things in the Modified Version:
1984
1985 A. Use in the Title Page (and on the covers, if any) a title
1986 distinct from that of the Document, and from those of
1987 previous versions (which should, if there were any, be listed
1988 in the History section of the Document). You may use the
1989 same title as a previous version if the original publisher of
1990 that version gives permission.
1991
1992 B. List on the Title Page, as authors, one or more persons or
1993 entities responsible for authorship of the modifications in
1994 the Modified Version, together with at least five of the
1995 principal authors of the Document (all of its principal
1996 authors, if it has fewer than five), unless they release you
1997 from this requirement.
1998
1999 C. State on the Title page the name of the publisher of the
2000 Modified Version, as the publisher.
2001
2002 D. Preserve all the copyright notices of the Document.
2003
2004 E. Add an appropriate copyright notice for your modifications
2005 adjacent to the other copyright notices.
2006
2007 F. Include, immediately after the copyright notices, a license
2008 notice giving the public permission to use the Modified
2009 Version under the terms of this License, in the form shown in
2010 the Addendum below.
2011
2012 G. Preserve in that license notice the full lists of Invariant
2013 Sections and required Cover Texts given in the Document's
2014 license notice.
2015
2016 H. Include an unaltered copy of this License.
2017
2018 I. Preserve the section Entitled "History", Preserve its Title,
2019 and add to it an item stating at least the title, year, new
2020 authors, and publisher of the Modified Version as given on
2021 the Title Page. If there is no section Entitled "History" in
2022 the Document, create one stating the title, year, authors,
2023 and publisher of the Document as given on its Title Page,
2024 then add an item describing the Modified Version as stated in
2025 the previous sentence.
2026
2027 J. Preserve the network location, if any, given in the Document
2028 for public access to a Transparent copy of the Document, and
2029 likewise the network locations given in the Document for
2030 previous versions it was based on. These may be placed in
2031 the "History" section. You may omit a network location for a
2032 work that was published at least four years before the
2033 Document itself, or if the original publisher of the version
2034 it refers to gives permission.
2035
2036 K. For any section Entitled "Acknowledgements" or "Dedications",
2037 Preserve the Title of the section, and preserve in the
2038 section all the substance and tone of each of the contributor
2039 acknowledgements and/or dedications given therein.
2040
2041 L. Preserve all the Invariant Sections of the Document,
2042 unaltered in their text and in their titles. Section numbers
2043 or the equivalent are not considered part of the section
2044 titles.
2045
2046 M. Delete any section Entitled "Endorsements". Such a section
2047 may not be included in the Modified Version.
2048
2049 N. Do not retitle any existing section to be Entitled
2050 "Endorsements" or to conflict in title with any Invariant
2051 Section.
2052
2053 O. Preserve any Warranty Disclaimers.
2054
2055 If the Modified Version includes new front-matter sections or
2056 appendices that qualify as Secondary Sections and contain no
2057 material copied from the Document, you may at your option
2058 designate some or all of these sections as invariant. To do this,
2059 add their titles to the list of Invariant Sections in the Modified
2060 Version's license notice. These titles must be distinct from any
2061 other section titles.
2062
2063 You may add a section Entitled "Endorsements", provided it contains
2064 nothing but endorsements of your Modified Version by various
2065 parties--for example, statements of peer review or that the text
2066 has been approved by an organization as the authoritative
2067 definition of a standard.
2068
2069 You may add a passage of up to five words as a Front-Cover Text,
2070 and a passage of up to 25 words as a Back-Cover Text, to the end
2071 of the list of Cover Texts in the Modified Version. Only one
2072 passage of Front-Cover Text and one of Back-Cover Text may be
2073 added by (or through arrangements made by) any one entity. If the
2074 Document already includes a cover text for the same cover,
2075 previously added by you or by arrangement made by the same entity
2076 you are acting on behalf of, you may not add another; but you may
2077 replace the old one, on explicit permission from the previous
2078 publisher that added the old one.
2079
2080 The author(s) and publisher(s) of the Document do not by this
2081 License give permission to use their names for publicity for or to
2082 assert or imply endorsement of any Modified Version.
2083
2084 5. COMBINING DOCUMENTS
2085
2086 You may combine the Document with other documents released under
2087 this License, under the terms defined in section 4 above for
2088 modified versions, provided that you include in the combination
2089 all of the Invariant Sections of all of the original documents,
2090 unmodified, and list them all as Invariant Sections of your
2091 combined work in its license notice, and that you preserve all
2092 their Warranty Disclaimers.
2093
2094 The combined work need only contain one copy of this License, and
2095 multiple identical Invariant Sections may be replaced with a single
2096 copy. If there are multiple Invariant Sections with the same name
2097 but different contents, make the title of each such section unique
2098 by adding at the end of it, in parentheses, the name of the
2099 original author or publisher of that section if known, or else a
2100 unique number. Make the same adjustment to the section titles in
2101 the list of Invariant Sections in the license notice of the
2102 combined work.
2103
2104 In the combination, you must combine any sections Entitled
2105 "History" in the various original documents, forming one section
2106 Entitled "History"; likewise combine any sections Entitled
2107 "Acknowledgements", and any sections Entitled "Dedications". You
2108 must delete all sections Entitled "Endorsements."
2109
2110 6. COLLECTIONS OF DOCUMENTS
2111
2112 You may make a collection consisting of the Document and other
2113 documents released under this License, and replace the individual
2114 copies of this License in the various documents with a single copy
2115 that is included in the collection, provided that you follow the
2116 rules of this License for verbatim copying of each of the
2117 documents in all other respects.
2118
2119 You may extract a single document from such a collection, and
2120 distribute it individually under this License, provided you insert
2121 a copy of this License into the extracted document, and follow
2122 this License in all other respects regarding verbatim copying of
2123 that document.
2124
2125 7. AGGREGATION WITH INDEPENDENT WORKS
2126
2127 A compilation of the Document or its derivatives with other
2128 separate and independent documents or works, in or on a volume of
2129 a storage or distribution medium, is called an "aggregate" if the
2130 copyright resulting from the compilation is not used to limit the
2131 legal rights of the compilation's users beyond what the individual
2132 works permit. When the Document is included in an aggregate, this
2133 License does not apply to the other works in the aggregate which
2134 are not themselves derivative works of the Document.
2135
2136 If the Cover Text requirement of section 3 is applicable to these
2137 copies of the Document, then if the Document is less than one half
2138 of the entire aggregate, the Document's Cover Texts may be placed
2139 on covers that bracket the Document within the aggregate, or the
2140 electronic equivalent of covers if the Document is in electronic
2141 form. Otherwise they must appear on printed covers that bracket
2142 the whole aggregate.
2143
2144 8. TRANSLATION
2145
2146 Translation is considered a kind of modification, so you may
2147 distribute translations of the Document under the terms of section
2148 4. Replacing Invariant Sections with translations requires special
2149 permission from their copyright holders, but you may include
2150 translations of some or all Invariant Sections in addition to the
2151 original versions of these Invariant Sections. You may include a
2152 translation of this License, and all the license notices in the
2153 Document, and any Warranty Disclaimers, provided that you also
2154 include the original English version of this License and the
2155 original versions of those notices and disclaimers. In case of a
2156 disagreement between the translation and the original version of
2157 this License or a notice or disclaimer, the original version will
2158 prevail.
2159
2160 If a section in the Document is Entitled "Acknowledgements",
2161 "Dedications", or "History", the requirement (section 4) to
2162 Preserve its Title (section 1) will typically require changing the
2163 actual title.
2164
2165 9. TERMINATION
2166
2167 You may not copy, modify, sublicense, or distribute the Document
2168 except as expressly provided under this License. Any attempt
2169 otherwise to copy, modify, sublicense, or distribute it is void,
2170 and will automatically terminate your rights under this License.
2171
2172 However, if you cease all violation of this License, then your
2173 license from a particular copyright holder is reinstated (a)
2174 provisionally, unless and until the copyright holder explicitly
2175 and finally terminates your license, and (b) permanently, if the
2176 copyright holder fails to notify you of the violation by some
2177 reasonable means prior to 60 days after the cessation.
2178
2179 Moreover, your license from a particular copyright holder is
2180 reinstated permanently if the copyright holder notifies you of the
2181 violation by some reasonable means, this is the first time you have
2182 received notice of violation of this License (for any work) from
2183 that copyright holder, and you cure the violation prior to 30 days
2184 after your receipt of the notice.
2185
2186 Termination of your rights under this section does not terminate
2187 the licenses of parties who have received copies or rights from
2188 you under this License. If your rights have been terminated and
2189 not permanently reinstated, receipt of a copy of some or all of
2190 the same material does not give you any rights to use it.
2191
2192 10. FUTURE REVISIONS OF THIS LICENSE
2193
2194 The Free Software Foundation may publish new, revised versions of
2195 the GNU Free Documentation License from time to time. Such new
2196 versions will be similar in spirit to the present version, but may
2197 differ in detail to address new problems or concerns. See
2198 `http://www.gnu.org/copyleft/'.
2199
2200 Each version of the License is given a distinguishing version
2201 number. If the Document specifies that a particular numbered
2202 version of this License "or any later version" applies to it, you
2203 have the option of following the terms and conditions either of
2204 that specified version or of any later version that has been
2205 published (not as a draft) by the Free Software Foundation. If
2206 the Document does not specify a version number of this License,
2207 you may choose any version ever published (not as a draft) by the
2208 Free Software Foundation. If the Document specifies that a proxy
2209 can decide which future versions of this License can be used, that
2210 proxy's public statement of acceptance of a version permanently
2211 authorizes you to choose that version for the Document.
2212
2213 11. RELICENSING
2214
2215 "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
2216 World Wide Web server that publishes copyrightable works and also
2217 provides prominent facilities for anybody to edit those works. A
2218 public wiki that anybody can edit is an example of such a server.
2219 A "Massive Multiauthor Collaboration" (or "MMC") contained in the
2220 site means any set of copyrightable works thus published on the MMC
2221 site.
2222
2223 "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
2224 license published by Creative Commons Corporation, a not-for-profit
2225 corporation with a principal place of business in San Francisco,
2226 California, as well as future copyleft versions of that license
2227 published by that same organization.
2228
2229 "Incorporate" means to publish or republish a Document, in whole or
2230 in part, as part of another Document.
2231
2232 An MMC is "eligible for relicensing" if it is licensed under this
2233 License, and if all works that were first published under this
2234 License somewhere other than this MMC, and subsequently
2235 incorporated in whole or in part into the MMC, (1) had no cover
2236 texts or invariant sections, and (2) were thus incorporated prior
2237 to November 1, 2008.
2238
2239 The operator of an MMC Site may republish an MMC contained in the
2240 site under CC-BY-SA on the same site at any time before August 1,
2241 2009, provided the MMC is eligible for relicensing.
2242
2243
2244 ADDENDUM: How to use this License for your documents
2245 ====================================================
2246
2247 To use this License in a document you have written, include a copy of
2248 the License in the document and put the following copyright and license
2249 notices just after the title page:
2250
2251 Copyright (C) YEAR YOUR NAME.
2252 Permission is granted to copy, distribute and/or modify this document
2253 under the terms of the GNU Free Documentation License, Version 1.3
2254 or any later version published by the Free Software Foundation;
2255 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
2256 Texts. A copy of the license is included in the section entitled ``GNU
2257 Free Documentation License''.
2258
2259 If you have Invariant Sections, Front-Cover Texts and Back-Cover
2260 Texts, replace the "with...Texts." line with this:
2261
2262 with the Invariant Sections being LIST THEIR TITLES, with
2263 the Front-Cover Texts being LIST, and with the Back-Cover Texts
2264 being LIST.
2265
2266 If you have Invariant Sections without Cover Texts, or some other
2267 combination of the three, merge those two alternatives to suit the
2268 situation.
2269
2270 If your document contains nontrivial examples of program code, we
2271 recommend releasing these examples in parallel under your choice of
2272 free software license, such as the GNU General Public License, to
2273 permit their use in free software.
2274
2275 \1f
2276 File: ada-mode.info, Node: Index, Prev: GNU Free Documentation License, Up: Top
2277
2278 Index
2279 *****
2280
2281