annotate man/ada-mode.texi @ 32782:14ce9aa3241a

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