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