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