Commit | Line | Data |
---|---|---|
be010748 | 1 | ;;; ada-mode.el --- An Emacs major-mode for editing Ada source. |
972579f9 | 2 | |
d03b8a2d | 3 | ;; Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc. |
972579f9 | 4 | |
d03b8a2d RS |
5 | ;; Authors: Rolf Ebert <ebert@inf.enst.fr> |
6 | ;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de> | |
7 | ;; Keywords: languages oop ada | |
52748d95 | 8 | ;; Rolf Ebert's version: 2.27 |
d03b8a2d RS |
9 | |
10 | ;; This file is part of GNU Emacs. | |
972579f9 RS |
11 | |
12 | ;; GNU Emacs is free software; you can redistribute it and/or modify | |
13 | ;; it under the terms of the GNU General Public License as published by | |
14 | ;; the Free Software Foundation; either version 2, or (at your option) | |
15 | ;; any later version. | |
16 | ||
17 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ;; GNU General Public License for more details. | |
21 | ||
22 | ;; You should have received a copy of the GNU General Public License | |
b578f267 EN |
23 | ;; along with GNU Emacs; see the file COPYING. If not, write to the |
24 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
25 | ;; Boston, MA 02111-1307, USA. | |
972579f9 RS |
26 | |
27 | ;;; This mode is a complete rewrite of a major mode for editing Ada 83 | |
f139ce87 | 28 | ;;; and Ada 95 source code under Emacs-19. It contains completely new |
972579f9 RS |
29 | ;;; indenting code and support for code browsing (see ada-xref). |
30 | ||
31 | ||
972579f9 RS |
32 | ;;; USAGE |
33 | ;;; ===== | |
cadd3658 | 34 | ;;; Emacs should enter Ada mode when you load an Ada source (*.ad[abs]). |
972579f9 RS |
35 | ;;; |
36 | ;;; When you have entered ada-mode, you may get more info by pressing | |
37 | ;;; C-h m. You may also get online help describing various functions by: | |
38 | ;;; C-h d <Name of function you want described> | |
39 | ||
40 | ||
41 | ;;; HISTORY | |
42 | ;;; ======= | |
3ca7b46f KH |
43 | ;;; The first Ada mode for GNU Emacs was written by V. Broman in |
44 | ;;; 1985. He based his work on the already existing Modula-2 mode. | |
45 | ;;; This was distributed as ada.el in versions of Emacs prior to 19.29. | |
972579f9 RS |
46 | ;;; |
47 | ;;; Lynn Slater wrote an extensive Ada mode in 1989. It consisted of | |
48 | ;;; several files with support for dired commands and other nice | |
49 | ;;; things. It is currently available from the PAL | |
50 | ;;; (wuarchive.wustl.edu:/languages/ada) as ada-mode-1.06a.tar.Z. | |
51 | ;;; | |
52 | ;;; The probably very first Ada mode (called electric-ada.el) was | |
53 | ;;; written by Steven D. Litvintchouk and Steven M. Rosen for the | |
54 | ;;; Gosling Emacs. L. Slater based his development on ada.el and | |
55 | ;;; electric-ada.el. | |
56 | ;;; | |
57 | ;;; The current Ada mode is a complete rewrite by M. Heritsch and | |
cadd3658 | 58 | ;;; R. Ebert. Some ideas from the Ada mode mailing list have been |
972579f9 RS |
59 | ;;; added. Some of the functionality of L. Slater's mode has not |
60 | ;;; (yet) been recoded in this new mode. Perhaps you prefer sticking | |
61 | ;;; to his version. | |
62 | ||
63 | ||
f139ce87 KH |
64 | ;;; KNOWN BUGS |
65 | ;;; ========== | |
972579f9 RS |
66 | ;;; |
67 | ;;; In the presence of comments and/or incorrect syntax | |
68 | ;;; ada-format-paramlist produces weird results. | |
f139ce87 | 69 | ;;; ------------------- |
cadd3658 RS |
70 | ;;; Character constants with otherwise syntactic relevant characters |
71 | ;;; like `(' or `"' throw indentation off the track. Fontification | |
72 | ;;; should work now in Emacs-19.35 | |
73 | ;;; C : constant Character := Character'('"'); | |
f139ce87 KH |
74 | ;;; ------------------- |
75 | ||
76 | ||
cadd3658 RS |
77 | ;;; TODO |
78 | ;;; ==== | |
79 | ;;; | |
80 | ;;; o bodify-single-subprogram | |
81 | ;;; o make a function "separate" and put it in the corresponding file. | |
82 | ||
83 | ||
f139ce87 KH |
84 | |
85 | ;;; CREDITS | |
86 | ;;; ======= | |
972579f9 | 87 | ;;; |
f139ce87 | 88 | ;;; Many thanks to |
3746aa55 | 89 | ;;; Philippe Waroquiers (PW) <philippe@cfmu.eurocontrol.be> in particular, |
f139ce87 KH |
90 | ;;; woodruff@stc.llnl.gov (John Woodruff) |
91 | ;;; jj@ddci.dk (Jesper Joergensen) | |
92 | ;;; gse@ocsystems.com (Scott Evans) | |
93 | ;;; comar@LANG8.CS.NYU.EDU (Cyrille Comar) | |
94 | ;;; and others for their valuable hints. | |
972579f9 | 95 | \f |
972579f9 RS |
96 | ;;;-------------------- |
97 | ;;; USER OPTIONS | |
98 | ;;;-------------------- | |
99 | ||
52748d95 RS |
100 | |
101 | ;; ---- customize support | |
102 | ||
103 | (defgroup ada nil | |
104 | "Major mode for editing Ada source in Emacs" | |
105 | :group 'languages) | |
106 | ||
972579f9 RS |
107 | ;; ---- configure indentation |
108 | ||
52748d95 RS |
109 | (defcustom ada-indent 3 |
110 | "*Defines the size of Ada indentation." | |
111 | :type 'integer | |
112 | :group 'ada) | |
972579f9 | 113 | |
52748d95 RS |
114 | (defcustom ada-broken-indent 2 |
115 | "*# of columns to indent the continuation of a broken line." | |
116 | :type 'integer | |
117 | :group 'ada) | |
972579f9 | 118 | |
52748d95 RS |
119 | (defcustom ada-label-indent -4 |
120 | "*# of columns to indent a label." | |
121 | :type 'integer | |
122 | :group 'ada) | |
972579f9 | 123 | |
52748d95 | 124 | (defcustom ada-stmt-end-indent 0 |
972579f9 | 125 | "*# of columns to indent a statement end keyword in a separate line. |
52748d95 RS |
126 | Examples are 'is', 'loop', 'record', ..." |
127 | :type 'integer | |
128 | :group 'ada) | |
972579f9 | 129 | |
52748d95 RS |
130 | (defcustom ada-when-indent 3 |
131 | "*Defines the indentation for 'when' relative to 'exception' or 'case'." | |
132 | :type 'integer | |
133 | :group 'ada) | |
972579f9 | 134 | |
52748d95 RS |
135 | (defcustom ada-indent-record-rel-type 3 |
136 | "*Defines the indentation for 'record' relative to 'type' or 'use'." | |
137 | :type 'integer | |
138 | :group 'ada) | |
972579f9 | 139 | |
52748d95 RS |
140 | (defcustom ada-indent-comment-as-code t |
141 | "*If non-nil, comment-lines get indented as Ada code." | |
142 | :type 'boolean | |
143 | :group 'ada) | |
972579f9 | 144 | |
52748d95 RS |
145 | (defcustom ada-indent-is-separate t |
146 | "*If non-nil, 'is separate' or 'is abstract' on a single line are indented." | |
147 | :type 'boolean | |
148 | :group 'ada) | |
972579f9 | 149 | |
52748d95 RS |
150 | (defcustom ada-indent-to-open-paren t |
151 | "*If non-nil, indent according to the innermost open parenthesis." | |
152 | :type 'boolean | |
153 | :group 'ada) | |
972579f9 | 154 | |
52748d95 RS |
155 | (defcustom ada-search-paren-char-count-limit 3000 |
156 | "*Search that many characters for an open parenthesis." | |
157 | :type 'integer | |
158 | :group 'ada) | |
972579f9 RS |
159 | |
160 | ||
161 | ;; ---- other user options | |
162 | ||
52748d95 | 163 | (defcustom ada-tab-policy 'indent-auto |
972579f9 | 164 | "*Control behaviour of the TAB key. |
5e1cecee RS |
165 | Must be one of `indent-rigidly', `indent-auto', `gei', `indent-af' |
166 | or `always-tab'. | |
972579f9 | 167 | |
5e1cecee RS |
168 | `indent-rigidly' : always adds ada-indent blanks at the beginning of the line. |
169 | `indent-auto' : use indentation functions in this file. | |
170 |