]> code.delx.au - gnu-emacs-elpa/blob - packages/ada-mode/ada-indent-user-options.el
Fix some quoting problems in doc strings
[gnu-emacs-elpa] / packages / ada-mode / ada-indent-user-options.el
1 ;; user options shared by Ada mode indentation engines -*- lexical-binding:t -*-
2 ;;
3 ;; Copyright (C) 2012, 2013, 2015 Free Software Foundation, Inc.
4 ;;
5 ;; Author: Stephen Leake <stephen_leake@member.fsf.org>
6 ;; Contributors: Simon Wright <simon.j.wright@mac.com>
7 ;;
8 ;; This file is part of GNU Emacs.
9 ;;
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation, either version 3 of the License, or
13 ;; (at your option) any later version.
14 ;;
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
19 ;;
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 ;;
23 ;;; History: see ada_mode.el
24
25 ;;;; code
26
27 (defgroup ada-indentation nil
28 "Indentation options for Ada source."
29 :group 'ada)
30
31 (defcustom ada-indent 3
32 "Size of Ada default indentation, when no other indentation is used.
33
34 Example :
35 procedure Foo is
36 begin
37 >>>null;"
38 :type 'integer
39 :safe #'integerp)
40 (make-variable-buffer-local 'ada-indent)
41
42 (defvar ada-broken-indent nil)
43 (make-obsolete-variable
44 'ada-broken-indent
45 'ada-indent-broken
46 "Emacs 24.4, Ada mode 5.0")
47
48 (defcustom ada-indent-broken
49 (if ada-broken-indent
50 (progn
51 (message "WARNING: setting `ada-indent-broken' to obsolete `ada-broken-indent'")
52 ada-broken-indent)
53 2)
54 "Indentation for the continuation of a broken line.
55
56 Example :
57 My_Var : My_Type :=
58 >>(Field1 => Value);"
59 :type 'integer
60 :safe #'integerp)
61 (make-variable-buffer-local 'ada-indent-broken)
62
63 (defcustom ada-indent-comment-col-0 nil
64 "If non-nil, comments currently starting in column 0 are left in column 0.
65 Otherwise, they are indented with previous comments or code."
66 :type 'boolean
67 :safe #'booleanp)
68 (make-variable-buffer-local 'ada-indent-comment-col-0)
69
70 (defcustom ada-indent-comment-gnat nil
71 "If non-nil, comments are indented to meet the GNAT comment style check.
72 That is, one of:
73
74 - multiple of ada-indent
75 - next non-blank line
76 - previous non-blank line
77
78 Otherwise, they are indented as a with previous comments or code."
79 :type 'boolean
80 :group 'ada-indentation
81 :safe #'booleanp)
82 (make-variable-buffer-local 'ada-indent-comment-gnat)
83
84 (defvar ada-label-indent nil)
85 (make-obsolete-variable
86 'ada-label-indent
87 'ada-indent-label
88 "Emacs 24.4, Ada mode 5.0")
89
90 (defcustom ada-indent-label
91 (if ada-label-indent
92 (progn
93 (message "WARNING: setting `ada-indent-label' to obsolete `ada-label-indent'")
94 ada-label-indent)
95 -3)
96 ;; Ada mode 4.01 and earlier default this to -4. But that is
97 ;; incompatible with the default gnat indentation style check, which
98 ;; wants all indentations to be a multiple of 3 (with some
99 ;; exceptions). So we default this to -3.
100 "Indentation for a loop, block, or statement label, relative to the item it labels.
101
102 Example :
103 Label_1 :
104 <<<<declare
105
106 <<Label_2>>
107 <<<<Foo := 0;"
108 :type 'integer
109 :safe #'integerp)
110 (make-variable-buffer-local 'ada-indent-label)
111
112 (defcustom ada-indent-record-rel-type 3
113 "Indentation for `record' relative to `type' or `use'.
114
115 An example is:
116 type A is
117 >>>record"
118 :type 'integer
119 :safe #'integerp)
120 (make-variable-buffer-local 'ada-indent-record-rel-type)
121
122 (defcustom ada-indent-renames 2
123 "Indentation for `renames' relative to the matching subprogram keyword.
124
125 For `renames' of non-subprograms the indentation is
126 `ada-indent-broken' relative to the line containing the matching
127 keyword.
128
129 If the subprogram has parameters then if `ada-indent-renames' is
130 zero or less the indentation is abs `ada-indent-renames' relative
131 to the open parenthesis; if `ada-indent-renames' is one or more
132 the indentation is relative to the line containing the keyword.
133
134 If the subprogram has no parameters then `ada-indent-broken' the
135 indentation is relative to the indentation of the line containing
136 the keyword.
137
138 Examples:
139 ada-indent-renames = 2
140 generic function A (B : Integer) return C
141 >>renames Foo;
142
143 ada-indent-renames = -1
144 function A (B : Integer)
145 return C
146 >>>>>>>>>>>renames Foo;"
147 :type 'integer
148 :safe #'integerp)
149 (make-variable-buffer-local 'ada-indent-renames)
150
151 (defcustom ada-indent-return 0
152 "Indentation for `return' relative to the matching `function' keyword.
153
154 If the function has parameters, then if `ada-indent-return' is
155 zero or less the indentation is abs `ada-indent-return' relative
156 to the open parenthesis; if `ada-indent-return' is one or more,
157 indentation is relative to line containing `function'.
158
159 If the function has no parameters, `ada-indent-broken' is used
160 relative to line containing `function'.
161
162 An example is:
163 function A (B : Integer)
164 >>>>>>>>>>>return C;"
165 :type 'integer
166 :safe #'integerp)
167 (make-variable-buffer-local 'ada-indent-return)
168
169 (defvar ada-use-indent nil)
170 (make-obsolete-variable
171 'ada-use-indent
172 'ada-indent-use
173 "Emacs 24.4, Ada mode 5.0")
174
175 (defcustom ada-indent-use
176 (if ada-use-indent
177 (progn
178 (message "WARNING: setting `ada-indent-use' to obsolete `ada-use-indent'")
179 ada-use-indent)
180 ada-indent-broken)
181 "Indentation for the lines in a `use' statement.
182
183 An example is:
184 use Ada.Text_IO,
185 >>Ada.Numerics;"
186 :type 'integer
187 :safe #'integerp)
188 (make-variable-buffer-local 'ada-indent-use)
189
190 (defvar ada-when-indent nil)
191 (make-obsolete-variable
192 'ada-when-indent
193 'ada-indent-when
194 "Emacs 24.4, Ada mode 5.0")
195
196 (defcustom ada-indent-when
197 (if ada-when-indent
198 (progn
199 (message "WARNING: setting `ada-indent-when' to obsolete `ada-when-indent'")
200 ada-when-indent)
201 3)
202 "Indentation for `when' relative to `exception', `case', `or' in select.
203
204 An example is:
205 case A is
206 >>>when B =>"
207 :type 'integer
208 :safe #'integerp)
209 (make-variable-buffer-local 'ada-indent-when)
210
211 (defvar ada-with-indent nil)
212 (make-obsolete-variable
213 'ada-with-indent
214 'ada-indent-with
215 "Emacs 24.4, Ada mode 5.0")
216
217 (defcustom ada-indent-with
218 (if ada-with-indent
219 (progn
220 (message "WARNING: setting `ada-indent-with' to obsolete `ada-with-indent'")
221 ada-with-indent)
222 ada-indent-broken)
223 "Indentation for the lines in a `with' context clause.
224
225 An example is:
226 with Ada.Text_IO,
227 >>Ada.Numerics;"
228 :type 'integer
229 :safe #'integerp)
230 (make-variable-buffer-local 'ada-indent-with)
231
232 (provide 'ada-indent-user-options)
233
234 ;; end file