diff options
| author | Richard M. Stallman | 1997-06-02 06:06:03 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-06-02 06:06:03 +0000 |
| commit | 52748d9537df3ddf8e72b6a6ca93822c22bc5553 (patch) | |
| tree | d7bc6fa884b38603f416bd58802d731421fe2876 | |
| parent | 97b7ec0bbd5dcf93586bab6158892bcb9cc860e1 (diff) | |
| download | emacs-52748d9537df3ddf8e72b6a6ca93822c22bc5553.tar.gz emacs-52748d9537df3ddf8e72b6a6ca93822c22bc5553.zip | |
Customize.
(ada-mode): Set up support for find-file.el.
(ada-other-file-alist): New variable moved from find-file.el.
(ada-search-directories): Likewise.
| -rw-r--r-- | lisp/progmodes/ada-mode.el | 250 |
1 files changed, 177 insertions, 73 deletions
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index bbb363e64bd..99b4f8659c2 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Authors: Rolf Ebert <ebert@inf.enst.fr> | 5 | ;; Authors: Rolf Ebert <ebert@inf.enst.fr> |
| 6 | ;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de> | 6 | ;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de> |
| 7 | ;; Keywords: languages oop ada | 7 | ;; Keywords: languages oop ada |
| 8 | ;; Rolf Ebert's version: 2.25 | 8 | ;; Rolf Ebert's version: 2.27 |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -97,43 +97,70 @@ | |||
| 97 | ;;; USER OPTIONS | 97 | ;;; USER OPTIONS |
| 98 | ;;;-------------------- | 98 | ;;;-------------------- |
| 99 | 99 | ||
| 100 | |||
| 101 | ;; ---- customize support | ||
| 102 | |||
| 103 | (defgroup ada nil | ||
| 104 | "Major mode for editing Ada source in Emacs" | ||
| 105 | :group 'languages) | ||
| 106 | |||
| 100 | ;; ---- configure indentation | 107 | ;; ---- configure indentation |
| 101 | 108 | ||
| 102 | (defvar ada-indent 3 | 109 | (defcustom ada-indent 3 |
| 103 | "*Defines the size of Ada indentation.") | 110 | "*Defines the size of Ada indentation." |
| 111 | :type 'integer | ||
| 112 | :group 'ada) | ||
| 104 | 113 | ||
| 105 | (defvar ada-broken-indent 2 | 114 | (defcustom ada-broken-indent 2 |
| 106 | "*# of columns to indent the continuation of a broken line.") | 115 | "*# of columns to indent the continuation of a broken line." |
| 116 | :type 'integer | ||
| 117 | :group 'ada) | ||
| 107 | 118 | ||
| 108 | (defvar ada-label-indent -4 | 119 | (defcustom ada-label-indent -4 |
| 109 | "*# of columns to indent a label.") | 120 | "*# of columns to indent a label." |
| 121 | :type 'integer | ||
| 122 | :group 'ada) | ||
| 110 | 123 | ||
| 111 | (defvar ada-stmt-end-indent 0 | 124 | (defcustom ada-stmt-end-indent 0 |
| 112 | "*# of columns to indent a statement end keyword in a separate line. | 125 | "*# of columns to indent a statement end keyword in a separate line. |
| 113 | Examples are 'is', 'loop', 'record', ...") | 126 | Examples are 'is', 'loop', 'record', ..." |
| 127 | :type 'integer | ||
| 128 | :group 'ada) | ||
| 114 | 129 | ||
| 115 | (defvar ada-when-indent 3 | 130 | (defcustom ada-when-indent 3 |
| 116 | "*Defines the indentation for 'when' relative to 'exception' or 'case'.") | 131 | "*Defines the indentation for 'when' relative to 'exception' or 'case'." |
| 132 | :type 'integer | ||
| 133 | :group 'ada) | ||
| 117 | 134 | ||
| 118 | (defvar ada-indent-record-rel-type 3 | 135 | (defcustom ada-indent-record-rel-type 3 |
| 119 | "*Defines the indentation for 'record' relative to 'type' or 'use'.") | 136 | "*Defines the indentation for 'record' relative to 'type' or 'use'." |
| 137 | :type 'integer | ||
| 138 | :group 'ada) | ||
| 120 | 139 | ||
| 121 | (defvar ada-indent-comment-as-code t | 140 | (defcustom ada-indent-comment-as-code t |
| 122 | "*If non-nil, comment-lines get indented as Ada code.") | 141 | "*If non-nil, comment-lines get indented as Ada code." |
| 142 | :type 'boolean | ||
| 143 | :group 'ada) | ||
| 123 | 144 | ||
| 124 | (defvar ada-indent-is-separate t | 145 | (defcustom ada-indent-is-separate t |
| 125 | "*If non-nil, 'is separate' or 'is abstract' on a single line are indented.") | 146 | "*If non-nil, 'is separate' or 'is abstract' on a single line are indented." |
| 147 | :type 'boolean | ||
| 148 | :group 'ada) | ||
| 126 | 149 | ||
| 127 | (defvar ada-indent-to-open-paren t | 150 | (defcustom ada-indent-to-open-paren t |
| 128 | "*If non-nil, indent according to the innermost open parenthesis.") | 151 | "*If non-nil, indent according to the innermost open parenthesis." |
| 152 | :type 'boolean | ||
| 153 | :group 'ada) | ||
| 129 | 154 | ||
| 130 | (defvar ada-search-paren-char-count-limit 3000 | 155 | (defcustom ada-search-paren-char-count-limit 3000 |
| 131 | "*Search that many characters for an open parenthesis.") | 156 | "*Search that many characters for an open parenthesis." |
| 157 | :type 'integer | ||
| 158 | :group 'ada) | ||
| 132 | 159 | ||
| 133 | 160 | ||
| 134 | ;; ---- other user options | 161 | ;; ---- other user options |
| 135 | 162 | ||
| 136 | (defvar ada-tab-policy 'indent-auto | 163 | (defcustom ada-tab-policy 'indent-auto |
| 137 | "*Control behaviour of the TAB key. | 164 | "*Control behaviour of the TAB key. |
| 138 | Must be one of `indent-rigidly', `indent-auto', `gei', `indent-af' | 165 | Must be one of `indent-rigidly', `indent-auto', `gei', `indent-af' |
| 139 | or `always-tab'. | 166 | or `always-tab'. |
| @@ -142,86 +169,163 @@ or `always-tab'. | |||
| 142 | `indent-auto' : use indentation functions in this file. | 169 | `indent-auto' : use indentation functions in this file. |
| 143 | `gei' : use David Kågedal's Generic Indentation Engine. | 170 | `gei' : use David Kågedal's Generic Indentation Engine. |
| 144 | `indent-af' : use Gary E. Barnes' ada-format.el | 171 | `indent-af' : use Gary E. Barnes' ada-format.el |
| 145 | `always-tab' : do indent-relative.") | 172 | `always-tab' : do indent-relative." |
| 146 | 173 | :type '(choice (const indent-auto) | |
| 147 | (defvar ada-move-to-declaration nil | 174 | (const indent-rigidly) |
| 175 | (const gei) | ||
| 176 | (const indent-af) | ||
| 177 | (const always-tab)) | ||
| 178 | :group 'ada) | ||
| 179 | |||
| 180 | (defcustom ada-move-to-declaration nil | ||
| 148 | "*If non-nil, `ada-move-to-start' moves point to the subprog declaration, | 181 | "*If non-nil, `ada-move-to-start' moves point to the subprog declaration, |
| 149 | not to 'begin'.") | 182 | not to 'begin'." |
| 150 | 183 | :type 'boolean | |
| 151 | (defvar ada-spec-suffix ".ads" | 184 | :group 'ada) |
| 152 | "*Suffix of Ada specification files.") | 185 | |
| 153 | 186 | (defcustom ada-spec-suffix ".ads" | |
| 154 | (defvar ada-body-suffix ".adb" | 187 | "*Suffix of Ada specification files." |
| 155 | "*Suffix of Ada body files.") | 188 | :type 'string |
| 156 | 189 | :group 'ada) | |
| 157 | (defvar ada-spec-suffix-as-regexp "\\.ads$" | 190 | |
| 158 | "*Regexp to find Ada specification files.") | 191 | (defcustom ada-body-suffix ".adb" |
| 159 | 192 | "*Suffix of Ada body files." | |
| 160 | (defvar ada-body-suffix-as-regexp "\\.adb$" | 193 | :type 'string |
| 161 | "*Regexp to find Ada body files.") | 194 | :group 'ada) |
| 162 | 195 | ||
| 163 | (defvar ada-language-version 'ada95 | 196 | (defcustom ada-spec-suffix-as-regexp "\\.ads$" |
| 164 | "*Do we program in `ada83' or `ada95'?") | 197 | "*Regexp to find Ada specification files." |
| 165 | 198 | :type 'string | |
| 166 | (defvar ada-case-keyword 'downcase-word | 199 | :group 'ada) |
| 200 | |||
| 201 | (defcustom ada-body-suffix-as-regexp "\\.adb$" | ||
| 202 | "*Regexp to find Ada body files." | ||
| 203 | :type 'string | ||
| 204 | :group 'ada) | ||
| 205 | |||
| 206 | (defvar ada-other-file-alist | ||
| 207 | (list | ||
| 208 | (list ada-spec-suffix-as-regexp (list ada-body-suffix)) | ||
| 209 | (list ada-body-suffix-as-regexp (list ada-spec-suffix)) | ||
| 210 | ) | ||
| 211 | "*Alist of extensions to find given the current file's extension. | ||
| 212 | |||
| 213 | This list should contain the most used extensions before the others, | ||
| 214 | since the search algorithm searches sequentially through each directory | ||
| 215 | specified in `ada-search-directories'. If a file is not found, a new one | ||
| 216 | is created with the first matching extension (`.adb' yields `.ads').") | ||
| 217 | |||
| 218 | (defcustom ada-search-directories | ||
| 219 | '("." "/usr/adainclude" "/usr/local/adainclude" "/opt/gnu/adainclude") | ||
| 220 | "*List of directories to search for Ada files. | ||
| 221 | See the description for the `ff-search-directories' variable." | ||
| 222 | :type '(repeat (choice :tag "Directory" | ||
| 223 | (const :tag "default" nil) | ||
| 224 | (directory :format "%v"))) | ||
| 225 | :group 'ada) | ||
| 226 | |||
| 227 | (defcustom ada-language-version 'ada95 | ||
| 228 | "*Do we program in `ada83' or `ada95'?" | ||
| 229 | :type '(choice (const ada83) | ||
| 230 | (const ada95)) | ||
| 231 | :group 'ada) | ||
| 232 | |||
| 233 | (defcustom ada-case-keyword 'downcase-word | ||
| 167 | "*Function to call to adjust the case of Ada keywords. | 234 | "*Function to call to adjust the case of Ada keywords. |
| 168 | It may be `downcase-word', `upcase-word', `ada-loose-case-word' or | 235 | It may be `downcase-word', `upcase-word', `ada-loose-case-word' or |
| 169 | `capitalize-word'.") | 236 | `capitalize-word'." |
| 170 | 237 | :type '(choice (const downcase-word) | |
| 171 | (defvar ada-case-identifier 'ada-loose-case-word | 238 | (const upcase-word) |
| 239 | (const capitalize-word) | ||
| 240 | (const ada-loose-case-word)) | ||
| 241 | :group 'ada) | ||
| 242 | |||
| 243 | (defcustom ada-case-identifier 'ada-loose-case-word | ||
| 172 | "*Function to call to adjust the case of an Ada identifier. | 244 | "*Function to call to adjust the case of an Ada identifier. |
| 173 | It may be `downcase-word', `upcase-word', `ada-loose-case-word' or | 245 | It may be `downcase-word', `upcase-word', `ada-loose-case-word' or |
| 174 | `capitalize-word'.") | 246 | `capitalize-word'." |
| 175 | 247 | :type '(choice (const downcase-word) | |
| 176 | (defvar ada-case-attribute 'capitalize-word | 248 | (const upcase-word) |
| 249 | (const capitalize-word) | ||
| 250 | (const ada-loose-case-word)) | ||
| 251 | :group 'ada) | ||
| 252 | |||
| 253 | (defcustom ada-case-attribute 'capitalize-word | ||
| 177 | "*Function to call to adjust the case of Ada attributes. | 254 | "*Function to call to adjust the case of Ada attributes. |
| 178 | It may be `downcase-word', `upcase-word', `ada-loose-case-word' or | 255 | It may be `downcase-word', `upcase-word', `ada-loose-case-word' or |
| 179 | `capitalize-word'.") | 256 | `capitalize-word'." |
| 180 | 257 | :type '(choice (const downcase-word) | |
| 181 | (defvar ada-auto-case t | 258 | (const upcase-word) |
| 259 | (const capitalize-word) | ||
| 260 | (const ada-loose-case-word)) | ||
| 261 | :group 'ada) | ||
| 262 | |||
| 263 | (defcustom ada-auto-case t | ||
| 182 | "*Non-nil automatically changes case of preceding word while typing. | 264 | "*Non-nil automatically changes case of preceding word while typing. |
| 183 | Casing is done according to `ada-case-keyword', `ada-case-identifier' | 265 | Casing is done according to `ada-case-keyword', `ada-case-identifier' |
| 184 | and `ada-case-attribute'.") | 266 | and `ada-case-attribute'." |
| 267 | :type 'boolean | ||
| 268 | :group 'ada) | ||
| 185 | 269 | ||
| 186 | (defvar ada-clean-buffer-before-saving t | 270 | (defcustom ada-clean-buffer-before-saving t |
| 187 | "*If non-nil, `remove-trailing-spaces' and `untabify' buffer before saving.") | 271 | "*If non-nil, `remove-trailing-spaces' and `untabify' buffer before saving." |
| 272 | :type 'boolean | ||
| 273 | :group 'ada) | ||
| 188 | 274 | ||
| 189 | (defvar ada-mode-hook nil | 275 | (defvar ada-mode-hook nil |
| 190 | "*List of functions to call when Ada mode is invoked. | 276 | "*List of functions to call when Ada mode is invoked. |
| 191 | This is a good place to add Ada environment specific bindings.") | 277 | This is a good place to add Ada environment specific bindings.") |
| 192 | 278 | ||
| 193 | (defvar ada-external-pretty-print-program "aimap" | 279 | (defcustom ada-external-pretty-print-program "aimap" |
| 194 | "*External pretty printer to call from within Ada mode.") | 280 | "*External pretty printer to call from within Ada mode." |
| 281 | :type 'string | ||
| 282 | :group 'ada) | ||
| 195 | 283 | ||
| 196 | (defvar ada-tmp-directory "/tmp/" | 284 | (defcustom ada-tmp-directory "/tmp/" |
| 197 | "*Directory to store the temporary file for the Ada pretty printer.") | 285 | "*Directory to store the temporary file for the Ada pretty printer." |
| 286 | :type 'string | ||
| 287 | :group 'ada) | ||
| 198 | 288 | ||
| 199 | (defvar ada-compile-options "-c" | 289 | (defcustom ada-compile-options "-c" |
| 200 | "*Buffer local options passed to the Ada compiler. | 290 | "*Buffer local options passed to the Ada compiler. |
| 201 | These options are used when the compiler is invoked on the current buffer.") | 291 | These options are used when the compiler is invoked on the current buffer." |
| 292 | :type 'string | ||
| 293 | :group 'ada) | ||
| 202 | (make-variable-buffer-local 'ada-compile-options) | 294 | (make-variable-buffer-local 'ada-compile-options) |
| 203 | 295 | ||
| 204 | (defvar ada-make-options "-c" | 296 | (defcustom ada-make-options "-c" |
| 205 | "*Buffer local options passed to `ada-compiler-make' (usually `gnatmake'). | 297 | "*Buffer local options passed to `ada-compiler-make' (usually `gnatmake'). |
| 206 | These options are used when `gnatmake' is invoked on the current buffer.") | 298 | These options are used when `gnatmake' is invoked on the current buffer." |
| 299 | :type 'string | ||
| 300 | :group 'ada) | ||
| 207 | (make-variable-buffer-local 'ada-make-options) | 301 | (make-variable-buffer-local 'ada-make-options) |
| 208 | 302 | ||
| 209 | (defvar ada-compiler-syntax-check "gcc -c -gnats" | 303 | (defcustom ada-compiler-syntax-check "gcc -c -gnats" |
| 210 | "*Compiler command with options for syntax checking.") | 304 | "*Compiler command with options for syntax checking." |
| 305 | :type 'string | ||
| 306 | :group 'ada) | ||
| 211 | 307 | ||
| 212 | (defvar ada-compiler-make "gnatmake" | 308 | (defcustom ada-compiler-make "gnatmake" |
| 213 | "*The `make' command for the given compiler.") | 309 | "*The `make' command for the given compiler." |
| 310 | :type 'string | ||
| 311 | :group 'ada) | ||
| 214 | 312 | ||
| 215 | (defvar ada-fill-comment-prefix "-- " | 313 | (defcustom ada-fill-comment-prefix "-- " |
| 216 | "*This is inserted in the first columns when filling a comment paragraph.") | 314 | "*This is inserted in the first columns when filling a comment paragraph." |
| 315 | :type 'string | ||
| 316 | :group 'ada) | ||
| 217 | 317 | ||
| 218 | (defvar ada-fill-comment-postfix " --" | 318 | (defcustom ada-fill-comment-postfix " --" |
| 219 | "*This is inserted at the end of each line when filling a comment paragraph. | 319 | "*This is inserted at the end of each line when filling a comment paragraph. |
| 220 | with `ada-fill-comment-paragraph-postfix'.") | 320 | with `ada-fill-comment-paragraph-postfix'." |
| 321 | :type 'string | ||
| 322 | :group 'ada) | ||
| 221 | 323 | ||
| 222 | (defvar ada-krunch-args "0" | 324 | (defcustom ada-krunch-args "0" |
| 223 | "*Argument of gnatkr, a string containing the max number of characters. | 325 | "*Argument of gnatkr, a string containing the max number of characters. |
| 224 | Set to 0, if you don't use crunched filenames.") | 326 | Set to 0, if you don't use crunched filenames." |
| 327 | :type 'string | ||
| 328 | :group 'ada) | ||
| 225 | 329 | ||
| 226 | ;;; ---- end of user configurable variables | 330 | ;;; ---- end of user configurable variables |
| 227 | 331 | ||