aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2009-06-09 18:39:29 +0000
committerChong Yidong2009-06-09 18:39:29 +0000
commitdeab46e0d7e92585e3196deb0c80f2065988bcf2 (patch)
treecd172c676f577847beef8daf8d0994caa066916e
parent0bcbaaaaa8581dc69ddfb7363df3be45c718118f (diff)
downloademacs-deab46e0d7e92585e3196deb0c80f2065988bcf2.tar.gz
emacs-deab46e0d7e92585e3196deb0c80f2065988bcf2.zip
* ada-mode.texi (Installation, Compile commands)
(Project File Overview, No project files, Set compiler options) (Use GNAT project file, Use multiple GNAT project files) (Identifier completion): Use @samp for menu items, and @kbd for key sequences.
-rw-r--r--doc/misc/ChangeLog8
-rw-r--r--doc/misc/ada-mode.texi82
2 files changed, 49 insertions, 41 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index fe048ee67d5..dee3ea17ea3 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,11 @@
12009-06-09 Chong Yidong <cyd@stupidchicken.com>
2
3 * ada-mode.texi (Installation, Compile commands)
4 (Project File Overview, No project files, Set compiler options)
5 (Use GNAT project file, Use multiple GNAT project files)
6 (Identifier completion): Use @samp for menu items, and @kbd for key
7 sequences (Bug#3504).
8
12009-06-04 Daiki Ueno <ueno@unixuser.org> 92009-06-04 Daiki Ueno <ueno@unixuser.org>
2 10
3 * gnus.texi (Security): Fix wording; add a link to epa.info. 11 * gnus.texi (Security): Fix wording; add a link to epa.info.
diff --git a/doc/misc/ada-mode.texi b/doc/misc/ada-mode.texi
index 274bdcb1ae0..8a2f10239e4 100644
--- a/doc/misc/ada-mode.texi
+++ b/doc/misc/ada-mode.texi
@@ -111,7 +111,7 @@ separate distribution may be more recent.
111For installing the separate distribution, see the @file{README} file 111For installing the separate distribution, see the @file{README} file
112in the distribution. 112in the distribution.
113 113
114To see what version of Ada mode you have installed, do @key{M-x 114To see what version of Ada mode you have installed, do @kbd{M-x
115ada-mode-version}. 115ada-mode-version}.
116 116
117The following files are provided with the Ada mode distribution: 117The following files are provided with the Ada mode distribution:
@@ -256,7 +256,7 @@ the GNAT compiler for simple projects (single files, or several files
256in a single directory). 256in a single directory).
257 257
258Even when no project file is used, the GUI project editor (menu 258Even when no project file is used, the GUI project editor (menu
259@key{Ada | Project | Edit}) shows the settings of the various project 259@samp{Ada | Project | Edit}) shows the settings of the various project
260file variables referenced here. 260file variables referenced here.
261 261
262@menu 262@menu
@@ -310,7 +310,7 @@ buffer. This runs @code{run_cmd} from the current project. The
310execution buffer allows for interactive input/output. 310execution buffer allows for interactive input/output.
311 311
312To modify the run command, in particular to provide or change the 312To modify the run command, in particular to provide or change the
313command line arguments, type @key{C-u} before invoking the command. 313command line arguments, type @kbd{C-u} before invoking the command.
314 314
315This command is not available for a cross-compilation toolchain. 315This command is not available for a cross-compilation toolchain.
316 316
@@ -320,7 +320,7 @@ It is important when using these commands to understand how
320 320
321Build runs 'gnatmake' on the main unit. During a typical edit/compile 321Build runs 'gnatmake' on the main unit. During a typical edit/compile
322session, this is the only command you need to invoke, which is why it 322session, this is the only command you need to invoke, which is why it
323is bound to @key{C-c C-c}. It will compile all files needed by the 323is bound to @kbd{C-c C-c}. It will compile all files needed by the
324main unit, and display compilation errors in any of them. 324main unit, and display compilation errors in any of them.
325 325
326Note that Build can be invoked from any Ada buffer; typically you will 326Note that Build can be invoked from any Ada buffer; typically you will
@@ -328,22 +328,22 @@ be fixing errors in files other than the main, but you don't have to
328switch back to the main to invoke the compiler again. 328switch back to the main to invoke the compiler again.
329 329
330Novices and students typically work on single-file Ada projects. In 330Novices and students typically work on single-file Ada projects. In
331this case, @key{C-c C-m} will normally be the only command needed; it 331this case, @kbd{C-c C-m} will normally be the only command needed; it
332will build the current file, rather than the last-built main. 332will build the current file, rather than the last-built main.
333 333
334There are three ways to change @code{main}: 334There are three ways to change @code{main}:
335 335
336@enumerate 336@enumerate
337@item 337@item
338Invoke @key{Ada | Set main and Build}, which sets @code{main} to 338Invoke @samp{Ada | Set main and Build}, which sets @code{main} to
339the current file. 339the current file.
340 340
341@item 341@item
342Invoke @key{Ada | Project | Edit}, edit @code{main} and 342Invoke @samp{Ada | Project | Edit}, edit @code{main} and
343@code{main}, and click @key{[save]} 343@code{main}, and click @samp{[save]}
344 344
345@item 345@item
346Invoke @key{Ada | Project | Load}, and load a project file that specifies @code{main} 346Invoke @samp{Ada | Project | Load}, and load a project file that specifies @code{main}
347 347
348@end enumerate 348@end enumerate
349 349
@@ -440,12 +440,12 @@ This algorithm always sets @code{ada-prj-default-project-file}, even
440when the file does not actually exist. 440when the file does not actually exist.
441 441
442To change the project file before or after the first one is found, 442To change the project file before or after the first one is found,
443invoke @key{Ada | Project | Load ...}. 443invoke @samp{Ada | Project | Load ...}.
444 444
445Or, in lisp, evaluate @code{(ada-set-default-project-file "/path/file.adp")}. 445Or, in lisp, evaluate @code{(ada-set-default-project-file "/path/file.adp")}.
446This sets @code{ada-prj-default-project-file}, and reads the project file. 446This sets @code{ada-prj-default-project-file}, and reads the project file.
447 447
448You can also specify a GNAT project file to @key{Ada | Project | Load 448You can also specify a GNAT project file to @samp{Ada | Project | Load
449...} or @code{ada-set-default-project-file}. Emacs Ada mode checks the 449...} or @code{ada-set-default-project-file}. Emacs Ada mode checks the
450file extension; if it is @code{.gpr}, the file is treated as a GNAT 450file extension; if it is @code{.gpr}, the file is treated as a GNAT
451project file. Any other extension is treated as an Emacs Ada mode 451project file. Any other extension is treated as an Emacs Ada mode
@@ -727,7 +727,7 @@ end Hello_Pkg;
727Yes, this is missing the keyword @code{body}; another compiler error 727Yes, this is missing the keyword @code{body}; another compiler error
728example. 728example.
729 729
730In buffer @file{hello.adb}, invoke @key{Ada | Check file}. You should 730In buffer @file{hello.adb}, invoke @samp{Ada | Check file}. You should
731get a @code{*compilation*} buffer containing something like (the 731get a @code{*compilation*} buffer containing something like (the
732directory paths will be different): 732directory paths will be different):
733 733
@@ -744,7 +744,7 @@ gnatmake: "c:/Examples/Example_1/hello.adb" compilation error
744If you have enabled font-lock, the lines with actual errors (starting 744If you have enabled font-lock, the lines with actual errors (starting
745with @file{hello.adb}) are highlighted, with the file name in red. 745with @file{hello.adb}) are highlighted, with the file name in red.
746 746
747Now type @key{C-x `} (on a PC keyboard, @key{`} is next to @key{1}). 747Now type @kbd{C-x `} (on a PC keyboard, @key{`} is next to @key{1}).
748Or you can click the middle mouse button on the first error line. The 748Or you can click the middle mouse button on the first error line. The
749compilation buffer scrolls to put the first error on the top line, and 749compilation buffer scrolls to put the first error on the top line, and
750point is put at the place of the error in the @file{hello.adb} buffer. 750point is put at the place of the error in the @file{hello.adb} buffer.
@@ -755,9 +755,9 @@ To fix the error, change the line to be
755 Ada.Text_IO.Put_Line ("hello from hello.adb"); 755 Ada.Text_IO.Put_Line ("hello from hello.adb");
756@end example 756@end example
757 757
758Now invoke @key{Ada | Show main}; this displays @file{Ada mode main: hello}. 758Now invoke @samp{Ada | Show main}; this displays @samp{Ada mode main: hello}.
759 759
760Now (in buffer @file{hello.adb}), invoke @key{Ada | Build}. You are 760Now (in buffer @file{hello.adb}), invoke @samp{Ada | Build}. You are
761prompted to save the file (if you haven't already). Then the 761prompted to save the file (if you haven't already). Then the
762compilation buffer is displayed again, containing: 762compilation buffer is displayed again, containing:
763 763
@@ -772,7 +772,7 @@ gnatlink hello.ali -o hello.exe -g
772The compilation has succeeded without errors; @file{hello.exe} now 772The compilation has succeeded without errors; @file{hello.exe} now
773exists in the same directory as @file{hello.adb}. 773exists in the same directory as @file{hello.adb}.
774 774
775Now invoke @key{Ada | Run}. A @file{*run*} buffer is displayed, 775Now invoke @samp{Ada | Run}. A @file{*run*} buffer is displayed,
776containing 776containing
777 777
778@example 778@example
@@ -784,7 +784,7 @@ Process run finished
784That completes the first part of this example. 784That completes the first part of this example.
785 785
786Now we will compile a multi-file project. Open the file 786Now we will compile a multi-file project. Open the file
787@file{hello_2.adb}, and invoke @key{Ada | Set main and Build}. This 787@file{hello_2.adb}, and invoke @samp{Ada | Set main and Build}. This
788finds an error in @file{hello_pkg.adb}: 788finds an error in @file{hello_pkg.adb}:
789 789
790@example 790@example
@@ -801,39 +801,39 @@ unless you use an Emacs Ada mode project file to specify the other directories;
801@xref{Set source search path}, or a GNAT project file; @ref{Use GNAT 801@xref{Set source search path}, or a GNAT project file; @ref{Use GNAT
802project file}. 802project file}.
803 803
804Invoke @key{Ada | Show main}; this displays @file{Ada mode main: hello_2}. 804Invoke @samp{Ada | Show main}; this displays @file{Ada mode main: hello_2}.
805 805
806Move to the error with @key{C-x `}, and fix the error by adding @code{body}: 806Move to the error with @kbd{C-x `}, and fix the error by adding @code{body}:
807 807
808@example 808@example
809package body Hello_Pkg is 809package body Hello_Pkg is
810@end example 810@end example
811 811
812Now, while still in @file{hello_pkg.adb}, invoke @key{Ada | Build}. 812Now, while still in @file{hello_pkg.adb}, invoke @samp{Ada | Build}.
813gnatmake successfully builds @file{hello_2}. This demonstrates that 813gnatmake successfully builds @file{hello_2}. This demonstrates that
814Emacs has remembered the main file, in the project variable 814Emacs has remembered the main file, in the project variable
815@code{main}, and used it for the Build command. 815@code{main}, and used it for the Build command.
816 816
817Finally, again while in @file{hello_pkg.adb}, invoke @key{Ada | Run}. 817Finally, again while in @file{hello_pkg.adb}, invoke @samp{Ada | Run}.
818The @code{*run*} buffer displays @code{Hello from hello_pkg.adb}. 818The @code{*run*} buffer displays @code{Hello from hello_pkg.adb}.
819 819
820One final point. If you switch back to buffer @file{hello.adb}, and 820One final point. If you switch back to buffer @file{hello.adb}, and
821invoke @key{Ada | Run}, @file{hello_2.exe} will be run. That is 821invoke @samp{Ada | Run}, @file{hello_2.exe} will be run. That is
822because @code{main} is still set to @code{hello_2}, as you can 822because @code{main} is still set to @code{hello_2}, as you can
823see when you invoke @key{Ada | Project | Edit}. 823see when you invoke @samp{Ada | Project | Edit}.
824 824
825There are three ways to change @code{main}: 825There are three ways to change @code{main}:
826 826
827@enumerate 827@enumerate
828@item 828@item
829Invoke @key{Ada | Set main and Build}, which sets @code{main} to 829Invoke @samp{Ada | Set main and Build}, which sets @code{main} to
830the current file. 830the current file.
831 831
832@item 832@item
833Invoke @key{Ada | Project | Edit}, edit @code{main}, and click @key{[save]} 833Invoke @samp{Ada | Project | Edit}, edit @code{main}, and click @samp{[save]}
834 834
835@item 835@item
836Invoke @key{Ada | Project | Load}, and load a project file that specifies @code{main} 836Invoke @samp{Ada | Project | Load}, and load a project file that specifies @code{main}
837 837
838@end enumerate 838@end enumerate
839 839
@@ -844,7 +844,7 @@ This example illustrates using an Emacs Ada mode project file to set a
844compiler option. 844compiler option.
845 845
846If you have files from @file{Example_1} open in Emacs, you should 846If you have files from @file{Example_1} open in Emacs, you should
847close them so you don't get confused. Use menu @key{File | Close 847close them so you don't get confused. Use menu @samp{File | Close
848(current buffer)}. 848(current buffer)}.
849 849
850In directory @file{Example_2}, create these files: 850In directory @file{Example_2}, create these files:
@@ -872,10 +872,10 @@ comp_opt=-gnatyt
872This tells the GNAT compiler to check for token spacing; in 872This tells the GNAT compiler to check for token spacing; in
873particular, there must be a space preceding a parenthesis. 873particular, there must be a space preceding a parenthesis.
874 874
875In buffer @file{hello.adb}, invoke @key{Ada | Project | Load...}, and 875In buffer @file{hello.adb}, invoke @samp{Ada | Project | Load...}, and
876select @file{Example_2/hello.adp}. 876select @file{Example_2/hello.adp}.
877 877
878Then, again in buffer @file{hello.adb}, invoke @key{Ada | Set main and 878Then, again in buffer @file{hello.adb}, invoke @samp{Ada | Set main and
879Build}. You should get a @code{*compilation*} buffer containing 879Build}. You should get a @code{*compilation*} buffer containing
880something like (the directory paths will be different): 880something like (the directory paths will be different):
881 881
@@ -956,10 +956,10 @@ comp_opt=-I..
956 956
957Note that there must be no trailing spaces. 957Note that there must be no trailing spaces.
958 958
959In buffer @file{hello_3.adb}, invoke @key{Ada | Project | Load...}, and 959In buffer @file{hello_3.adb}, invoke @samp{Ada | Project | Load...}, and
960select @file{Example_3/Other/other.adp}. 960select @file{Example_3/Other/other.adp}.
961 961
962Then, again in @file{hello_3.adb}, invoke @key{Ada | Set main and 962Then, again in @file{hello_3.adb}, invoke @samp{Ada | Set main and
963Build}. You should get a @code{*compilation*} buffer containing 963Build}. You should get a @code{*compilation*} buffer containing
964something like (the directory paths will be different): 964something like (the directory paths will be different):
965 965
@@ -976,7 +976,7 @@ Compare the @code{-cargs} option to the compiler output in @ref{Set
976compiler options}; this shows that @file{other.adp} is being used to 976compiler options}; this shows that @file{other.adp} is being used to
977set the compiler options. 977set the compiler options.
978 978
979Move to the error with @key{C-x `}. Ada mode searches the list of 979Move to the error with @kbd{C-x `}. Ada mode searches the list of
980directories given by @code{src_dir} for the file mentioned in the 980directories given by @code{src_dir} for the file mentioned in the
981compiler error message. 981compiler error message.
982 982
@@ -1039,10 +1039,10 @@ Project Hello_4 is
1039end Hello_4; 1039end Hello_4;
1040@end example 1040@end example
1041 1041
1042In buffer @file{hello_4.adb}, invoke @key{Ada | Project | Load...}, and 1042In buffer @file{hello_4.adb}, invoke @samp{Ada | Project | Load...}, and
1043select @file{Example_4/Gnat_Project/hello_4.gpr}. 1043select @file{Example_4/Gnat_Project/hello_4.gpr}.
1044 1044
1045Then, again in @file{hello_4.adb}, invoke @key{Ada | Set main and 1045Then, again in @file{hello_4.adb}, invoke @samp{Ada | Set main and
1046Build}. You should get a @code{*compilation*} buffer containing 1046Build}. You should get a @code{*compilation*} buffer containing
1047something like (the directory paths will be different): 1047something like (the directory paths will be different):
1048 1048
@@ -1106,10 +1106,10 @@ Project Hello_5 is
1106end Hello_5; 1106end Hello_5;
1107@end example 1107@end example
1108 1108
1109In buffer @file{hello_5.adb}, invoke @key{Ada | Project | Load...}, and 1109In buffer @file{hello_5.adb}, invoke @samp{Ada | Project | Load...}, and
1110select @file{Example_5/hello_5.adp}. 1110select @file{Example_5/hello_5.adp}.
1111 1111
1112Then, again in @file{hello_5.adb}, invoke @key{Ada | Set main and 1112Then, again in @file{hello_5.adb}, invoke @samp{Ada | Set main and
1113Build}. You should get a @code{*compilation*} buffer containing 1113Build}. You should get a @code{*compilation*} buffer containing
1114something like (the directory paths will be different): 1114something like (the directory paths will be different):
1115 1115
@@ -1122,7 +1122,7 @@ hello_pkg.adb:2:08: keyword "body" expected here [see file name]
1122gnatmake: "c:\examples\example_4\hello_pkg.adb" compilation error 1122gnatmake: "c:\examples\example_4\hello_pkg.adb" compilation error
1123@end example 1123@end example
1124 1124
1125Now type @key{C-x `}. @file{Example_4/hello_pkg.adb} is shown, 1125Now type @kbd{C-x `}. @file{Example_4/hello_pkg.adb} is shown,
1126demonstrating that @file{hello_5.gpr} and @file{hello_4.gpr} are being 1126demonstrating that @file{hello_5.gpr} and @file{hello_4.gpr} are being
1127used to set the compilation search path. 1127used to set the compilation search path.
1128 1128
@@ -1196,17 +1196,17 @@ are the only words starting with @samp{my} in any of the opened files,
1196then you will have this scenario: 1196then you will have this scenario:
1197 1197
1198@example 1198@example
1199You type: my@key{M-/} 1199You type: my@kbd{M-/}
1200Emacs inserts: @samp{my_identifier} 1200Emacs inserts: @samp{my_identifier}
1201If you press @key{M-/} once again, Emacs replaces @samp{my_identifier} with 1201If you press @kbd{M-/} once again, Emacs replaces @samp{my_identifier} with
1202@samp{my_subprogram}. 1202@samp{my_subprogram}.
1203Pressing @key{M-/} once more will bring you back to @samp{my_identifier}. 1203Pressing @kbd{M-/} once more will bring you back to @samp{my_identifier}.
1204@end example 1204@end example
1205 1205
1206This is a very fast way to do completion, and the casing of words will 1206This is a very fast way to do completion, and the casing of words will
1207also be respected. 1207also be respected.
1208 1208
1209The second method (@key{C-TAB}) is specific to Ada mode and the GNAT 1209The second method (@kbd{C-@key{TAB}}) is specific to Ada mode and the GNAT
1210compiler. Emacs will search the cross-information for possible 1210compiler. Emacs will search the cross-information for possible
1211completions. 1211completions.
1212 1212