23868
|
1 ;;; ada-stmt.el - An extension to Ada mode for inserting statement templates.
|
|
2
|
|
3 ;; Copyright (C) 1987, 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
|
|
4
|
23869
|
5 ;; Authors: Daniel Pfeiffer <occitan@esperanto.org>, Markus Heritsch,
|
|
6 ;; Rolf Ebert <ebert@waporo.muc.de>
|
23868
|
7 ;; Maintainer: Rolf Ebert <ebert@waporo.muc.de>
|
|
8 ;; Keywords: languages, ada
|
|
9 ;; Rolf Ebert's version: 2.26
|
|
10
|
|
11 ;;; Commentary:
|
|
12
|
|
13 ;;
|
|
14 ;; put the following statement in your .emacs:
|
|
15 ;; (require 'ada-stmt)
|
|
16 ;;
|
|
17
|
|
18 ;;; History:
|
|
19
|
|
20 ;; Created May 1987.
|
|
21 ;; Original version from V. Bowman as in ada.el of Emacs-18
|
|
22 ;; (borrowed heavily from Mick Jordan's Modula-2 package for GNU,
|
|
23 ;; as modified by Peter Robinson, Michael Schmidt, and Tom Perrine.)
|
|
24 ;;
|
|
25 ;; Sep 1993. Daniel Pfeiffer <pfeiffer@cict.fr> (DP)
|
|
26 ;; Introduced statement.el for smaller code and user configurability.
|
|
27 ;;
|
|
28 ;; Nov 1993. Rolf Ebert <ebert@enpc.fr> (RE) Moved the
|
|
29 ;; skeleton generation into this separate file. The code still is
|
|
30 ;; essentially written by DP
|
|
31 ;;
|
|
32 ;; Adapted Jun 1994. Markus Heritsch
|
|
33 ;; <Markus.Heritsch@studbox.uni-stuttgart.de> (MH)
|
|
34 ;; added menu bar support for templates
|
|
35 ;;
|
|
36 ;; 1994/12/02 Christian Egli <cegli@hcsd.hac.com>
|
|
37 ;; General cleanup and bug fixes.
|
|
38 ;;
|
|
39 ;; 1995/12/20 John Hutchison <hutchiso@epi.syr.ge.com>
|
|
40 ;; made it work with skeleton.el from emacs-19.30. Several
|
|
41 ;; enhancements and bug fixes.
|
|
42
|
|
43 ;; BUGS:
|
|
44 ;;;> I have the following suggestions for the function template: 1) I
|
|
45 ;;;> don't want it automatically assigning it a name for the return variable. I
|
|
46 ;;;> never want it to be called "Result" because that is nondescriptive. If you
|
|
47 ;;;> must define a variable, give me the ability to specify its name.
|
|
48 ;;;>
|
|
49 ;;;> 2) You do not provide a type for variable 'Result'. Its type is the same
|
|
50 ;;;> as the function's return type, which the template knows, so why force me
|
|
51 ;;;> to type it in?
|
|
52 ;;;>
|
|
53
|
|
54 ;;;It would be nice if one could configure such layout details separately
|
|
55 ;;;without patching the LISP code. Maybe the metalanguage used in ada-stmt.el
|
|
56 ;;;could be taken even further, providing the user with some nice syntax
|
|
57 ;;;for describing layout. Then my own hacks would survive the next
|
|
58 ;;;update of the package :-)
|
|
59
|
|
60
|
|
61 ;;; Code:
|
|
62
|
|
63 (require 'ada-mode)
|
|
64 (require 'skeleton)
|
|
65 (require 'easymenu)
|
|
66
|
|
67 (defgroup ada-stmt nil
|
|
68 "Extension to Ada mode for inserting statement templates"
|
|
69 :group 'ada)
|
|
70
|
|
71 (defcustom ada-stmt-use-debug t
|
|
72 "*Toggle to insert ada debug code parts."
|
|
73 :type 'boolean
|
|
74 :group 'ada-stmt)
|
|
75
|
|
76
|
|
77 (defcustom ada-debug-call-str "pragma Debug (%s);"
|
|
78 "*Debug call code to insert."
|
|
79 :type 'string
|
|
80 :group 'ada-stmt)
|
|
81
|
|
82
|
|
83 (defcustom ada-debug-exception-str "pragma Debug (%s);"
|
|
84 "*Debug exception code to insert."
|
|
85 :type 'string
|
|
86 :group 'ada-stmt)
|
|
87
|
|
88
|
|
89
|
|
90 (defun ada-func-or-proc-name ()
|
|
91 ;; Get the name of the current function or procedure."
|
|
92 (save-excursion
|
|
93 (let ((case-fold-search t))
|
|
94 (if (re-search-backward ada-procedure-start-regexp nil t)
|
|
95 (buffer-substring (match-beginning 2) (match-end 2))
|
|
96 "NAME?"))))
|
|
97
|
|
98
|
|
99 (defun ada-toggle-debugging ()
|
|
100 "Toggles behaviour of `ada-debug-info-insertion'."
|
|
101 (interactive)
|
|
102 (setq ada-stmt-use-debug (not ada-stmt-use-debug))
|
|
103 (if ada-stmt-use-debug
|
|
104 (message "Debugging enabled")
|
|
105 (message "Debugging disabled")))
|
|
106
|
|
107
|
|
108 (defvar ada-template-map nil
|
|
109 "Keymap used in Ada mode for smart template operations.")
|
|
110
|
|
111
|
|
112 (let ((ada-mp (make-sparse-keymap)))
|
|
113 (define-key ada-mp "h" 'ada-header)
|
|
114 ; (define-key ada-mp "p" 'ada-toggle-prompt-pseudo)
|
|
115 (define-key ada-mp "(" 'insert-parentheses)
|
|
116 (define-key ada-mp "\C-a" 'ada-array)
|
|
117 (define-key ada-mp "b" 'ada-exception-block)
|
|
118 (define-key ada-mp "d" 'ada-declare-block)
|
|
119 (define-key ada-mp "c" 'ada-case)
|
|
120 (define-key ada-mp "\C-e" 'ada-elsif)
|
|
121 (define-key ada-mp "e" 'ada-else)
|
|
122 (define-key ada-mp "\C-k" 'ada-package-spec)
|
|
123 (define-key ada-mp "k" 'ada-package-body)
|
|
124 (define-key ada-mp "\C-p" 'ada-procedure-spec)
|
|
125 (define-key ada-mp "\C-f" 'ada-function-spec)
|
|
126 (define-key ada-mp "p" 'ada-subprogram-body)
|
|
127 (define-key ada-mp "f" 'ada-for-loop)
|
|
128 (define-key ada-mp "i" 'ada-if)
|
|
129 (define-key ada-mp "l" 'ada-loop)
|
|
130 (define-key ada-mp "\C-r" 'ada-record)
|
|
131 (define-key ada-mp "\C-s" 'ada-subtype)
|
|
132 (define-key ada-mp "S" 'ada-tabsize)
|
|
133 (define-key ada-mp "\C-t" 'ada-task-spec)
|
|
134 (define-key ada-mp "t" 'ada-task-body)
|
|
135 (define-key ada-mp "\C-y" 'ada-type)
|
|
136 (define-key ada-mp "\C-v" 'ada-private)
|
|
137 (define-key ada-mp "u" 'ada-use)
|
|
138 (define-key ada-mp "\C-u" 'ada-with)
|
|
139 (define-key ada-mp "\C-w" 'ada-when)
|
|
140 (define-key ada-mp "w" 'ada-while-loop)
|
|
141 (define-key ada-mp "\C-x" 'ada-exception)
|
|
142 (define-key ada-mp "x" 'ada-exit)
|
|
143 (setq ada-template-map ada-mp))
|
|
144
|
|
145 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
146 ;; Place the templates into Ada Mode. They may be inserted under any key.
|
|
147 ;; C-c C-t will be the default. If you use templates alot, you
|
|
148 ;; may want to consider moving the binding to another key in your .emacs
|
|
149 ;; file. Be sure to (require 'ada-stmt) first.
|
|
150 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
151 ;(define-key ada-mode-map "\C-ct" ada-template-map)
|
|
152 (define-key ada-mode-map "\C-c\C-t" ada-template-map)
|
|
153
|
|
154 ;;; ---- statement skeletons ------------------------------------------
|
|
155
|
|
156 (define-skeleton ada-array
|
|
157 "Insert array type definition. Uses the minibuffer to prompt
|
|
158 for component type and index subtypes."
|
|
159 ()
|
|
160 "array (" ("index definition: " str ", " ) -2 ") of " _ ?\;)
|
|
161
|
|
162
|
|
163 (define-skeleton ada-case
|
|
164 "Build skeleton case statement, prompting for the selector expression.
|
|
165 Also builds the first when clause."
|
|
166 "[selector expression]: "
|
|
167 "case " str " is" \n
|
|
168 > "when " ("discrete choice: " str " | ") -3 " =>" \n
|
|
169 > _ \n
|
|
170 < < "end case;")
|
|
171
|
|
172
|
|
173 (define-skeleton ada-when
|
|
174 "Start a case statement alternative with a when clause."
|
|
175 ()
|
|
176 < "when " ("discrete choice: " str " | ") -3 " =>" \n
|
|
177 >)
|
|
178
|
|
179
|
|
180 (define-skeleton ada-declare-block
|
|
181 "Insert a block with a declare part.
|
|
182 Indent for the first declaration."
|
|
183 "[block name]: "
|
|
184 < str & ?: & \n
|
|
185 > "declare" \n
|
|
186 > _ \n
|
|
187 < "begin" \n
|
|
188 > \n
|
|
189 < "end " str | -1 ?\;)
|
|
190
|
|
191
|
|
192 (define-skeleton ada-exception-block
|
|
193 "Insert a block with an exception part.
|
|
194 Indent for the first line of code."
|
|
195 "[block name]: "
|
|
196 < str & ?: & \n
|
|
197 > "begin" \n
|
|
198 > _ \n
|
|
199 < "exception" \n
|
|
200 > \n
|
|
201 < "end " str | -1 ?\;)
|
|
202
|
|
203
|
|
204 (define-skeleton ada-exception
|
|
205 "Insert an indented exception part into a block."
|
|
206 ()
|
|
207 < "exception" \n
|
|
208 >)
|
|
209
|
|
210
|
|
211 (define-skeleton ada-exit-1
|
|
212 "Insert then exit condition of the exit statement, prompting for condition."
|
|
213 "[exit condition]: "
|
|
214 "when " str | -5)
|
|
215
|
|
216
|
|
217 (define-skeleton ada-exit
|
|
218 "Insert an exit statement, prompting for loop name and condition."
|
|
219 "[name of loop to exit]: "
|
|
220 "exit " str & ?\
|
|
221 (ada-exit-1)
|
|
222 | -1 ?\;)
|
|
223
|
|
224
|
|
225 (defun ada-header ()
|
|
226 "Insert a descriptive header at the top of the file."
|
|
227 (interactive "*")
|
|
228 (save-excursion
|
|
229 (goto-char (point-min))
|
|
230 (if (fboundp 'make-header)
|
|
231 (make-header)
|
|
232 (ada-header-tmpl))))
|
|
233
|
|
234
|
|
235 (define-skeleton ada-header-tmpl
|
|
236 "Insert a comment block containing the module title, author, etc."
|
|
237 "[Description]: "
|
|
238 "-- -*- Mode: Ada -*-"
|
|
239 "\n-- Filename : " (buffer-name)
|
|
240 "\n-- Description : " str
|
|
241 "\n-- Author : " (user-full-name)
|
|
242 "\n-- Created On : " (current-time-string)
|
|
243 "\n-- Last Modified By: ."
|
|
244 "\n-- Last Modified On: ."
|
|
245 "\n-- Update Count : 0"
|
|
246 "\n-- Status : Unknown, Use with caution!"
|
|
247 "\n")
|
|
248
|
|
249
|
|
250 (define-skeleton ada-display-comment
|
|
251 "Inserts three comment lines, making a display comment."
|
|
252 ()
|
|
253 "--\n-- " _ "\n--")
|
|
254
|
|
255
|
|
256 (define-skeleton ada-if
|
|
257 "Insert skeleton if statment, prompting for a boolean-expression."
|
|
258 "[condition]: "
|
|
259 "if " str " then" \n
|
|
260 > _ \n
|
|
261 < "end if;")
|
|
262
|
|
263
|
|
264 (define-skeleton ada-elsif
|
|
265 "Add an elsif clause to an if statement,
|
|
266 prompting for the boolean-expression."
|
|
267 "[condition]: "
|
|
268 < "elsif " str " then" \n
|
|
269 >)
|
|
270
|
|
271
|
|
272 (define-skeleton ada-else
|
|
273 "Add an else clause inside an if-then-end-if clause."
|
|
274 ()
|
|
275 < "else" \n
|
|
276 >)
|
|
277
|
|
278
|
|
279 (define-skeleton ada-loop
|
|
280 "Insert a skeleton loop statement. The exit statement is added by hand."
|
|
281 "[loop name]: "
|
|
282 < str & ?: & \n
|
|
283 > "loop" \n
|
|
284 > _ \n
|
|
285 < "end loop " str | -1 ?\;)
|
|
286
|
|
287
|
|
288 (define-skeleton ada-for-loop-prompt-variable
|
|
289 "Prompt for the loop variable."
|
|
290 "[loop variable]: "
|
|
291 str)
|
|
292
|
|
293
|
|
294 (define-skeleton ada-for-loop-prompt-range
|
|
295 "Prompt for the loop range."
|
|
296 "[loop range]: "
|
|
297 str)
|
|
298
|
|
299
|
|
300 (define-skeleton ada-for-loop
|
|
301 "Build a skeleton for-loop statement, prompting for the loop parameters."
|
|
302 "[loop name]: "
|
|
303 < str & ?: & \n
|
|
304 > "for "
|
|
305 (ada-for-loop-prompt-variable)
|
|
306 " in "
|
|
307 (ada-for-loop-prompt-range)
|
|
308 " loop" \n
|
|
309 > _ \n
|
|
310 < "end loop " str | -1 ?\;)
|
|
311
|
|
312
|
|
313 (define-skeleton ada-while-loop-prompt-entry-condition
|
|
314 "Prompt for the loop entry condition."
|
|
315 "[entry condition]: "
|
|
316 str)
|
|
317
|
|
318
|
|
319 (define-skeleton ada-while-loop
|
|
320 "Insert a skeleton while loop statement."
|
|
321 "[loop name]: "
|
|
322 < str & ?: & \n
|
|
323 > "while "
|
|
324 (ada-while-loop-prompt-entry-condition)
|
|
325 " loop" \n
|
|
326 > _ \n
|
|
327 < "end loop " str | -1 ?\;)
|
|
328
|
|
329
|
|
330 (define-skeleton ada-package-spec
|
|
331 "Insert a skeleton package specification."
|
|
332 "[package name]: "
|
|
333 "package " str " is" \n
|
|
334 > _ \n
|
|
335 < "end " str ?\;)
|
|
336
|
|
337
|
|
338 (define-skeleton ada-package-body
|
|
339 "Insert a skeleton package body -- includes a begin statement."
|
|
340 "[package name]: "
|
|
341 "package body " str " is" \n
|
|
342 > _ \n
|
|
343 ; < "begin" \n
|
|
344 < "end " str ?\;)
|
|
345
|
|
346
|
|
347 (define-skeleton ada-private
|
|
348 "Undent and start a private section of a package spec. Reindent."
|
|
349 ()
|
|
350 < "private" \n
|
|
351 >)
|
|
352
|
|
353
|
|
354 (define-skeleton ada-function-spec-prompt-return
|
|
355 "Prompts for function result type."
|
|
356 "[result type]: "
|
|
357 str)
|
|
358
|
|
359
|
|
360 (define-skeleton ada-function-spec
|
|
361 "Insert a function specification. Prompts for name and arguments."
|
|
362 "[function name]: "
|
|
363 "function " str
|
|
364 " (" ("[parameter_specification]: " str "; " ) -2 ")"
|
|
365 " return "
|
|
366 (ada-function-spec-prompt-return)
|
|
367 ";" \n )
|
|
368
|
|
369
|
|
370 (define-skeleton ada-procedure-spec
|
|
371 "Insert a procedure specification, prompting for its name and arguments."
|
|
372 "[procedure name]: "
|
|
373 "procedure " str
|
|
374 " (" ("[parameter_specification]: " str "; " ) -2 ")"
|
|
375 ";" \n )
|
|
376
|
|
377
|
|
378 (define-skeleton ada-subprogram-body
|
|
379 "Insert frame for subprogram body.
|
|
380 Invoke right after `ada-function-spec' or `ada-procedure-spec'."
|
|
381 ()
|
|
382 ;; Remove `;' from subprogram decl
|
|
383 (save-excursion
|
|
384 (ada-search-ignore-string-comment ada-subprog-start-re t nil)
|
|
385 (ada-search-ignore-string-comment "(" nil nil t)
|
|
386 (backward-char 1)
|
|
387 (forward-sexp 1)
|
|
388 (if (looking-at ";")
|
|
389 (delete-char 1)))
|
|
390 < "is" \n
|
|
391 > _ \n
|
|
392 < "begin" \n
|
|
393 > (if ada-stmt-use-debug
|
|
394 (format ada-debug-call-str (ada-func-or-proc-name))) \n
|
|
395 > \n
|
|
396 < (if ada-stmt-use-debug
|
|
397 "exception") & \n
|
|
398 > (if ada-stmt-use-debug
|
|
399 "when others =>") & \n
|
|
400 > (if ada-stmt-use-debug
|
|
401 (format ada-debug-exception-str (ada-func-or-proc-name))) \n
|
|
402 < < "end "
|
|
403 (ada-func-or-proc-name)
|
|
404 ?\;)
|
|
405
|
|
406
|
|
407 (define-skeleton ada-separate
|
|
408 "Finish a body stub with `separate'."
|
|
409 ()
|
|
410 > "separate;" \n
|
|
411 <)
|
|
412
|
|
413
|
|
414 ;(define-skeleton ada-with
|
|
415 ; "Inserts a with clause, prompting for the list of units depended upon."
|
|
416 ; "[list of units depended upon]: "
|
|
417 ; "with " str ?\;)
|
|
418
|
|
419 ;(define-skeleton ada-use
|
|
420 ; "Inserts a use clause, prompting for the list of packages used."
|
|
421 ; "[list of packages used]: "
|
|
422 ; "use " str ?\;)
|
|
423
|
|
424
|
|
425 (define-skeleton ada-record
|
|
426 "Insert a skeleton record type declaration."
|
|
427 ()
|
|
428 "record" \n
|
|
429 > _ \n
|
|
430 < "end record;")
|
|
431
|
|
432
|
|
433 (define-skeleton ada-subtype
|
|
434 "Start insertion of a subtype declaration, prompting for the subtype name."
|
|
435 "[subtype name]: "
|
|
436 "subtype " str " is " _ ?\;
|
|
437 (not (message "insert subtype indication.")))
|
|
438
|
|
439
|
|
440 (define-skeleton ada-type
|
|
441 "Start insertion of a type declaration, prompting for the type name."
|
|
442 "[type name]: "
|
|
443 "type " str ?\(
|
|
444 ("[discriminant specs]: " str " ")
|
|
445 | (backward-delete-char 1) | ?\)
|
|
446 " is "
|
|
447 (not (message "insert type definition.")))
|
|
448
|
|
449
|
|
450 (define-skeleton ada-task-body
|
|
451 "Insert a task body, prompting for the task name."
|
|
452 "[task name]: "
|
|
453 "task body " str " is\n"
|
|
454 "begin\n"
|
|
455 > _ \n
|
|
456 < "end " str ";" )
|
|
457
|
|
458
|
|
459 (define-skeleton ada-task-spec
|
|
460 "Insert a task specification, prompting for the task name."
|
|
461 "[task name]: "
|
|
462 "task " str
|
|
463 " (" ("[discriminant]: " str "; ") ") is\n"
|
|
464 > "entry " _ \n
|
|
465 <"end " str ";" )
|
|
466
|
|
467
|
|
468 (define-skeleton ada-get-param1
|
|
469 "Prompt for arguments and if any enclose them in brackets."
|
|
470 ()
|
|
471 ("[parameter_specification]: " str "; " ) & -2 & ")"
|
|
472 )
|
|
473
|
|
474
|
|
475 (define-skeleton ada-get-param
|
|
476 "Prompt for arguments and if any enclose them in brackets."
|
|
477 ()
|
|
478 " ("
|
|
479 (ada-get-param1) | -2
|
|
480 )
|
|
481
|
|
482
|
|
483 (define-skeleton ada-entry
|
|
484 "Insert a task entry, prompting for the entry name."
|
|
485 "[entry name]: "
|
|
486 "entry " str
|
|
487 (ada-get-param)
|
|
488 ";" \n
|
|
489 ; (ada-indent-current)
|
|
490 )
|
|
491
|
|
492
|
|
493 (define-skeleton ada-entry-family-prompt-discriminant
|
|
494 "Insert a entry specification, prompting for the entry name."
|
|
495 "[discriminant name]: "
|
|
496 str)
|
|
497
|
|
498
|
|
499 (define-skeleton ada-entry-family
|
|
500 "Insert a entry specification, prompting for the entry name."
|
|
501 "[entry name]: "
|
|
502 "entry " str
|
|
503 " (" (ada-entry-family-prompt-discriminant) ")"
|
|
504 (ada-get-param)
|
|
505 ";" \n
|
|
506 ;(ada-indent-current)
|
|
507 )
|
|
508
|
|
509
|
|
510 (define-skeleton ada-select
|
|
511 "Insert a select block."
|
|
512 ()
|
|
513 "select\n"
|
|
514 > _ \n
|
|
515 < "end select;")
|
|
516
|
|
517
|
|
518 (define-skeleton ada-accept-1
|
|
519 "Insert a condition statement, prompting for the condition name."
|
|
520 "[condition]: "
|
|
521 "when " str | -5 )
|
|
522
|
|
523
|
|
524 (define-skeleton ada-accept-2
|
|
525 "Insert an accept statement, prompting for the name and arguments."
|
|
526 "[accept name]: "
|
|
527 > "accept " str
|
|
528 (ada-get-param)
|
|
529 ; " (" ("[parameter_specification]: " str "; ") -2 ")"
|
|
530 " do" \n
|
|
531 > _ \n
|
|
532 < "end " str ";" )
|
|
533
|
|
534
|
|
535 (define-skeleton ada-accept
|
|
536 "Insert an accept statement (prompt for condition, name and arguments)."
|
|
537 ()
|
|
538 > (ada-accept-1) & " =>\n"
|
|
539 (ada-accept-2)
|
|
540 )
|
|
541
|
|
542
|
|
543 (define-skeleton ada-or-accept
|
|
544 "Insert a or statement, prompting for the condition name."
|
|
545 ()
|
|
546 < "or\n"
|
|
547 (ada-accept)
|
|
548 )
|
|
549
|
|
550
|
|
551 (define-skeleton ada-or-delay
|
|
552 "Insert a delay statement, prompting for the delay value."
|
|
553 "[delay value]: "
|
|
554 < "or\n"
|
|
555 > "delay " str ";")
|
|
556
|
|
557
|
|
558 (define-skeleton ada-or-terminate
|
|
559 "Insert a terminate statement."
|
|
560 ()
|
|
561 < "or\n"
|
|
562 > "terminate;")
|
|
563
|
|
564
|
|
565 ;; ----
|
|
566 (defun ada-adjust-case-skeleton ()
|
|
567 "Adjusts the case of the text inserted by a skeleton."
|
|
568 (save-excursion
|
|
569 (let ((aa-end (point)))
|
|
570 (ada-adjust-case-region
|
|
571 (progn (goto-char beg) (forward-word -1) (point))
|
|
572 (goto-char aa-end))
|
|
573 )))
|
|
574
|
|
575
|
|
576 ;; ---- add menu 'Statements' in Ada mode (MH)
|
|
577 (defun ada-add-statement-menu ()
|
|
578 "Adds the menu 'Statements' to the menu bar in Ada mode."
|
|
579 (easy-menu-define ada-stmt-menu ada-mode-map
|
|
580 "Menu for statement templates in Ada."
|
|
581 '("Statements"
|
|
582 ; ["Toggle Prompt/Pseudo Code" toggle-skeleton-no-prompt t]
|
|
583 ["Toggle: Debugging" ada-toggle-debugging t]
|
|
584 ; ["-------" nil nil]
|
|
585 ["Header" (ada-header) t]
|
|
586 ["-------" nil nil]
|
|
587 ["package Body" (ada-package-body) t]
|
|
588 ["package Spec" (ada-package-spec) t]
|
|
589 ["function Spec" (ada-function-spec) t]
|
|
590 ["procedure Spec" (ada-procedure-spec) t]
|
|
591 ["proc/func Body" (ada-subprogram-body) t]
|
|
592 ["task Body" (ada-task-body) t]
|
|
593 ["task Spec" (ada-task-spec) t]
|
|
594 ["declare Block" (ada-declare-block) t]
|
|
595 ["exception Block" (ada-exception-block) t]
|
|
596 ["------" nil nil]
|
|
597 ["entry" (ada-entry) t]
|
|
598 ["entry family" (ada-entry-family) t]
|
|
599 ["select" (ada-select) t]
|
|
600 ["accept" (ada-accept) t]
|
|
601 ["or accept" (ada-or-accept) t]
|
|
602 ["or delay" (ada-or-delay) t]
|
|
603 ["or terminate" (ada-or-terminate) t]
|
|
604 ["-----" nil nil]
|
|
605 ["type" (ada-type) t]
|
|
606 ["private" (ada-private) t]
|
|
607 ["subtype" (ada-subtype) t]
|
|
608 ["record" (ada-record) t]
|
|
609 ["array" (ada-array) t]
|
|
610 ["------" nil nil]
|
|
611 ["if" (ada-if) t]
|
|
612 ["else" (ada-else) t]
|
|
613 ["elsif" (ada-elsif) t]
|
|
614 ["case" (ada-case) t]
|
|
615 ["-----" nil nil]
|
|
616 ["while Loop" (ada-while-loop) t]
|
|
617 ["for Loop" (ada-for-loop) t]
|
|
618 ["loop" (ada-loop) t]
|
|
619 ["---" nil nil]
|
|
620 ["exception" (ada-exception) t]
|
|
621 ["exit" (ada-exit) t]
|
|
622 ["when" (ada-when) t]
|
|
623 ))
|
|
624 (if (ada-xemacs)
|
|
625 (progn
|
|
626 (easy-menu-add ada-stmt-menu)
|
|
627 (setq mode-popup-menu (cons "Ada Mode" ada-stmt-menu)))))
|
|
628
|
|
629
|
|
630
|
|
631 (add-hook 'ada-mode-hook 'ada-add-statement-menu)
|
|
632 (add-hook 'ada-mode-hook '(lambda ()
|
|
633 (setq skeleton-further-elements
|
|
634 '((< '(backward-delete-char-untabify
|
|
635 (min ada-indent (current-column))))))
|
|
636 (add-hook 'skeleton-end-hook
|
|
637 'ada-adjust-case-skeleton)))
|
|
638
|
|
639 (provide 'ada-stmt)
|
|
640
|
|
641 ;;; ada-stmt.el ends here
|