1 ;;; user options shared by Ada mode indentation engines
3 ;; Copyright (C) 2012, 2013 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.
39 :group 'ada-indentation
41 (make-variable-buffer-local 'ada-indent)
43 (defvar ada-broken-indent nil)
44 (make-obsolete-variable
47 "Emacs 24.4, Ada mode 5.0")
49 (defcustom ada-indent-broken
52 (message "WARNING: setting `ada-indent-broken' to obsolete `ada-broken-indent'")
55 "Indentation for the continuation of a broken line.
61 :group 'ada-indentation
63 (make-variable-buffer-local 'ada-indent-broken)
65 (defcustom ada-indent-comment-col-0 nil
66 "If non-nil, comments currently starting in column 0 are left in column 0.
67 Otherwise, they are indented with previous comments or code."
69 :group 'ada-indentation
71 (make-variable-buffer-local 'ada-indent-comment-col-0)
73 (defvar ada-label-indent nil)
74 (make-obsolete-variable
77 "Emacs 24.4, Ada mode 5.0")
79 (defcustom ada-indent-label
82 (message "WARNING: setting `ada-indent-label' to obsolete `ada-label-indent'")
85 ;; Ada mode 4.01 and earlier default this to -4. But that is
86 ;; incompatible with the default gnat indentation style check, which
87 ;; wants all indentations to be a multiple of 3 (with some
88 ;; exceptions). So we default this to -3.
89 "Indentation for a loop, block, or statement label, relative to the item it labels.
98 :group 'ada-indentation
100 (make-variable-buffer-local 'ada-indent-label)
102 (defcustom ada-indent-record-rel-type 3
103 "Indentation for 'record' relative to 'type' or 'use'.
111 (make-variable-buffer-local 'ada-indent-record-rel-type)
113 (defcustom ada-indent-renames 2
114 "Indentation for 'renames' relative to the matching subprogram keyword.
116 For 'renames' of non-subprograms the indentation is
117 `ada-indent-broken' relative to the line containing the matching
120 If the subprogram has parameters then if `ada-indent-renames' is
121 zero or less the indentation is abs `ada-indent-renames' relative
122 to the open parenthesis; if `ada-indent-renames' is one or more
123 the indentation is relative to the line containing the keyword.
125 If the subprogram has no parameters then `ada-indent-broken' the
126 indentation is relative to the indentation of the line containing
130 ada-indent-renames = 2
131 generic function A (B : Integer) return C
134 ada-indent-renames = -1
135 function A (B : Integer)
137 >>>>>>>>>>>renames Foo;"
141 (make-variable-buffer-local 'ada-indent-renames)
143 (defcustom ada-indent-return 0
144 "Indentation for 'return' relative to the matching 'function' keyword.
146 If the function has parameters, then if `ada-indent-return' is
147 zero or less the indentation is abs `ada-indent-return' relative
148 to the open parenthesis; if `ada-indent-return' is one or more,
149 indentation is relative to line containing 'function'.
151 If the function has no parameters, `ada-indent-broken' is used
152 relative to line containing 'function'.
155 function A (B : Integer)
156 >>>>>>>>>>>return C;"
160 (make-variable-buffer-local 'ada-indent-return)
162 (defvar ada-use-indent nil)
163 (make-obsolete-variable
166 "Emacs 24.4, Ada mode 5.0")
168 (defcustom ada-indent-use
171 (message "WARNING: setting `ada-indent-use' to obsolete `ada-use-indent'")
174 "Indentation for the lines in a 'use' statement.
182 (make-variable-buffer-local 'ada-indent-use)
184 (defvar ada-when-indent nil)
185 (make-obsolete-variable
188 "Emacs 24.4, Ada mode 5.0")
190 (defcustom ada-indent-when
193 (message "WARNING: setting `ada-indent-when' to obsolete `ada-when-indent'")
196 "Indentation for 'when' relative to 'exception', 'case', 'or' in select.
204 (make-variable-buffer-local 'ada-indent-when)
206 (defvar ada-with-indent nil)
207 (make-obsolete-variable
210 "Emacs 24.4, Ada mode 5.0")
212 (defcustom ada-indent-with
215 (message "WARNING: setting `ada-indent-with' to obsolete `ada-with-indent'")
218 "Indentation for the lines in a 'with' context clause.
226 (make-variable-buffer-local 'ada-indent-with)
228 (provide 'ada-indent-user-options)