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 (defvar ada-label-indent nil)
71 (make-obsolete-variable
74 "Emacs 24.4, Ada mode 5.0")
76 (defcustom ada-indent-label
79 (message "WARNING: setting `ada-indent-label' to obsolete `ada-label-indent'")
82 ;; Ada mode 4.01 and earlier default this to -4. But that is
83 ;; incompatible with the default gnat indentation style check, which
84 ;; wants all indentations to be a multiple of 3 (with some
85 ;; exceptions). So we default this to -3.
86 "Indentation for a loop, block, or statement label, relative to the item it labels.
96 (make-variable-buffer-local 'ada-indent-label)
98 (defcustom ada-indent-record-rel-type 3
99 "Indentation for 'record' relative to 'type' or 'use'.
106 (make-variable-buffer-local 'ada-indent-record-rel-type)
108 (defcustom ada-indent-renames 2
109 "Indentation for 'renames' relative to the matching subprogram keyword.
111 For 'renames' of non-subprograms the indentation is
112 `ada-indent-broken' relative to the line containing the matching
115 If the subprogram has parameters then if `ada-indent-renames' is
116 zero or less the indentation is abs `ada-indent-renames' relative
117 to the open parenthesis; if `ada-indent-renames' is one or more
118 the indentation is relative to the line containing the keyword.
120 If the subprogram has no parameters then `ada-indent-broken' the
121 indentation is relative to the indentation of the line containing
125 ada-indent-renames = 2
126 generic function A (B : Integer) return C
129 ada-indent-renames = -1
130 function A (B : Integer)
132 >>>>>>>>>>>renames Foo;"
135 (make-variable-buffer-local 'ada-indent-renames)
137 (defcustom ada-indent-return 0
138 "Indentation for 'return' relative to the matching 'function' keyword.
140 If the function has parameters, then if `ada-indent-return' is
141 zero or less the indentation is abs `ada-indent-return' relative
142 to the open parenthesis; if `ada-indent-return' is one or more,
143 indentation is relative to line containing 'function'.
145 If the function has no parameters, `ada-indent-broken' is used
146 relative to line containing 'function'.
149 function A (B : Integer)
150 >>>>>>>>>>>return C;"
153 (make-variable-buffer-local 'ada-indent-return)
155 (defvar ada-use-indent nil)
156 (make-obsolete-variable
159 "Emacs 24.4, Ada mode 5.0")
161 (defcustom ada-indent-use
164 (message "WARNING: setting `ada-indent-use' to obsolete `ada-use-indent'")
167 "Indentation for the lines in a 'use' statement.
174 (make-variable-buffer-local 'ada-indent-use)
176 (defvar ada-when-indent nil)
177 (make-obsolete-variable
180 "Emacs 24.4, Ada mode 5.0")
182 (defcustom ada-indent-when
185 (message "WARNING: setting `ada-indent-when' to obsolete `ada-when-indent'")
188 "Indentation for 'when' relative to 'exception', 'case', 'or' in select.
195 (make-variable-buffer-local 'ada-indent-when)
197 (defvar ada-with-indent nil)
198 (make-obsolete-variable
201 "Emacs 24.4, Ada mode 5.0")
203 (defcustom ada-indent-with
206 (message "WARNING: setting `ada-indent-with' to obsolete `ada-with-indent'")
209 "Indentation for the lines in a 'with' context clause.
216 (make-variable-buffer-local 'ada-indent-with)
218 (provide 'ada-indent-user-options)