1 ;; user options shared by Ada mode indentation engines -*- lexical-binding:t -*-
3 ;; Copyright (C) 2012, 2013, 2015 Free Software Foundation, Inc.
5 ;; Author: Stephen Leake <stephen_leake@member.fsf.org>
6 ;; Contributors: Simon Wright <simon.j.wright@mac.com>
8 ;; This file is part of GNU Emacs.
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.
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.
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/>.
23 ;;; History: see ada_mode.el
27 (defgroup ada-indentation nil
28 "Indentation options for Ada source."
31 (defcustom ada-indent 3
32 "Size of Ada default indentation, when no other indentation is used.
40 (make-variable-buffer-local 'ada-indent)
42 (defvar ada-broken-indent nil)
43 (make-obsolete-variable
46 "Emacs 24.4, Ada mode 5.0")
48 (defcustom ada-indent-broken
51 (message "WARNING: setting `ada-indent-broken' to obsolete `ada-broken-indent'")
54 "Indentation for the continuation of a broken line.
61 (make-variable-buffer-local 'ada-indent-broken)
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."
68 (make-variable-buffer-local 'ada-indent-comment-col-0)
70 (defcustom ada-indent-comment-gnat nil
71 "If non-nil, comments are indented to meet the GNAT comment style check.
74 - multiple of ada-indent
76 - previous non-blank line
78 Otherwise, they are indented as a with previous comments or code."
80 :group 'ada-indentation
82 (make-variable-buffer-local 'ada-indent-comment-gnat)
84 (defvar ada-label-indent nil)
85 (make-obsolete-variable
88 "Emacs 24.4, Ada mode 5.0")
90 (defcustom ada-indent-label
93 (message "WARNING: setting `ada-indent-label' to obsolete `ada-label-indent'")
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.
110 (make-variable-buffer-local 'ada-indent-label)
112 (defcustom ada-indent-record-rel-type 3
113 "Indentation for 'record' relative to 'type' or 'use'.
120 (make-variable-buffer-local 'ada-indent-record-rel-type)
122 (defcustom ada-indent-renames 2
123 "Indentation for 'renames' relative to the matching subprogram keyword.
125 For 'renames' of non-subprograms the indentation is
126 `ada-indent-broken' relative to the line containing the matching
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.
134 If the subprogram has no parameters then `ada-indent-broken' the
135 indentation is relative to the indentation of the line containing
139 ada-indent-renames = 2
140 generic function A (B : Integer) return C
143 ada-indent-renames = -1
144 function A (B : Integer)
146 >>>>>>>>>>>renames Foo;"
149 (make-variable-buffer-local 'ada-indent-renames)
151 (defcustom ada-indent-return 0
152 "Indentation for 'return' relative to the matching 'function' keyword.
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'.
159 If the function has no parameters, `ada-indent-broken' is used
160 relative to line containing 'function'.
163 function A (B : Integer)
164 >>>>>>>>>>>return C;"
167 (make-variable-buffer-local 'ada-indent-return)
169 (defvar ada-use-indent nil)
170 (make-obsolete-variable
173 "Emacs 24.4, Ada mode 5.0")
175 (defcustom ada-indent-use
178 (message "WARNING: setting `ada-indent-use' to obsolete `ada-use-indent'")
181 "Indentation for the lines in a 'use' statement.
188 (make-variable-buffer-local 'ada-indent-use)
190 (defvar ada-when-indent nil)
191 (make-obsolete-variable
194 "Emacs 24.4, Ada mode 5.0")
196 (defcustom ada-indent-when
199 (message "WARNING: setting `ada-indent-when' to obsolete `ada-when-indent'")
202 "Indentation for 'when' relative to 'exception', 'case', 'or' in select.
209 (make-variable-buffer-local 'ada-indent-when)
211 (defvar ada-with-indent nil)
212 (make-obsolete-variable
215 "Emacs 24.4, Ada mode 5.0")
217 (defcustom ada-indent-with
220 (message "WARNING: setting `ada-indent-with' to obsolete `ada-with-indent'")
223 "Indentation for the lines in a 'with' context clause.
230 (make-variable-buffer-local 'ada-indent-with)
232 (provide 'ada-indent-user-options)