Mercurial > emacs
annotate lisp/progmodes/ada-stmt.el @ 45928:5ed355930e4a
Update copyright. Improve `revision' info.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 20 Jun 2002 16:55:33 +0000 |
parents | e34b692b2fa9 |
children | 1b89f0ef4d72 |
rev | line source |
---|---|
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
34400
diff
changeset
|
1 ;;; ada-stmt.el --- an extension to Ada mode for inserting statement templates |
23868 | 2 |
45928
5ed355930e4a
Update copyright. Improve `revision' info.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44467
diff
changeset
|
3 ;; Copyright(C) 1987, 93, 94, 96, 97, 98, 99, 2000, 2001, 2002 |
32301
0f1f7e931493
Fix header line, copyright notice.
Dave Love <fx@gnu.org>
parents:
30409
diff
changeset
|
4 ;; Free Software Foundation, Inc. |
23868 | 5 |
45928
5ed355930e4a
Update copyright. Improve `revision' info.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44467
diff
changeset
|
6 ;; Ada Core Technologies's version: Revision: 1.21 (GNAT 3.15) |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
34400
diff
changeset
|
7 |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
34400
diff
changeset
|
8 ;; This file is part of GNU Emacs. |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
9 |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
10 ;; Authors: Daniel Pfeiffer, Markus Heritsch, Rolf Ebert <ebert@waporo.muc.de> |
34400
a5fbe8c7b12d
Update `maintainer'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
33823
diff
changeset
|
11 ;; Maintainer: Emmanuel Briot <briot@gnat.com> |
23868 | 12 ;; Keywords: languages, ada |
13 ;; Rolf Ebert's version: 2.26 | |
14 | |
15 ;;; Commentary: | |
44467
e34b692b2fa9
Menu changed from Statements to Templates.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
16 ;; This file is now automatically loaded from ada-mode.el, and creates a submenu |
e34b692b2fa9
Menu changed from Statements to Templates.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
17 ;; in Ada/ on the menu bar. |
23868 | 18 |
19 ;;; History: | |
20 | |
21 ;; Created May 1987. | |
22 ;; Original version from V. Bowman as in ada.el of Emacs-18 | |
23 ;; (borrowed heavily from Mick Jordan's Modula-2 package for GNU, | |
24 ;; as modified by Peter Robinson, Michael Schmidt, and Tom Perrine.) | |
25 ;; | |
26 ;; Sep 1993. Daniel Pfeiffer <pfeiffer@cict.fr> (DP) | |
27 ;; Introduced statement.el for smaller code and user configurability. | |
28 ;; | |
29 ;; Nov 1993. Rolf Ebert <ebert@enpc.fr> (RE) Moved the | |
30 ;; skeleton generation into this separate file. The code still is | |
31 ;; essentially written by DP | |
32 ;; | |
33 ;; Adapted Jun 1994. Markus Heritsch | |
34 ;; <Markus.Heritsch@studbox.uni-stuttgart.de> (MH) | |
35 ;; added menu bar support for templates | |
36 ;; | |
37 ;; 1994/12/02 Christian Egli <cegli@hcsd.hac.com> | |
38 ;; General cleanup and bug fixes. | |
39 ;; | |
40 ;; 1995/12/20 John Hutchison <hutchiso@epi.syr.ge.com> | |
26226
b63d041c9108
Changed format of years in copyright notices.
Gerd Moellmann <gerd@gnu.org>
parents:
26000
diff
changeset
|
41 ;; made it work with skeleton.el from Emacs-19.30. Several |
23868 | 42 ;; enhancements and bug fixes. |
43 | |
44 ;; BUGS: | |
45 ;;;> I have the following suggestions for the function template: 1) I | |
46 ;;;> don't want it automatically assigning it a name for the return variable. I | |
47 ;;;> never want it to be called "Result" because that is nondescriptive. If you | |
48 ;;;> must define a variable, give me the ability to specify its name. | |
49 ;;;> | |
50 ;;;> 2) You do not provide a type for variable 'Result'. Its type is the same | |
51 ;;;> as the function's return type, which the template knows, so why force me | |
52 ;;;> to type it in? | |
53 ;;;> | |
54 | |
55 ;;;It would be nice if one could configure such layout details separately | |
56 ;;;without patching the LISP code. Maybe the metalanguage used in ada-stmt.el | |
57 ;;;could be taken even further, providing the user with some nice syntax | |
58 ;;;for describing layout. Then my own hacks would survive the next | |
59 ;;;update of the package :-) | |
60 | |
61 | |
62 ;;; Code: | |
63 | |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
64 (eval-when-compile |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
65 (condition-case nil (require 'skeleton) |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
66 (error nil))) |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
67 |
23868 | 68 (require 'easymenu) |
69 | |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
70 (defun ada-stmt-add-to-ada-menu () |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
71 "Add a new submenu to the Ada menu." |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
72 (interactive) |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
73 (let ((menu '(["Header" ada-header t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
74 ["-" nil nil] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
75 ["Package Body" ada-package-body t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
76 ["Package Spec" ada-package-spec t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
77 ["Function Spec" ada-function-spec t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
78 ["Procedure Spec" ada-procedure-spec t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
79 ["Proc/func Body" ada-subprogram-body t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
80 ["Task Body" ada-task-body t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
81 ["Task Spec" ada-task-spec t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
82 ["Declare Block" ada-declare-block t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
83 ["Exception Block" ada-exception-block t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
84 ["--" nil nil] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
85 ["Entry" ada-entry t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
86 ["Entry family" ada-entry-family t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
87 ["Select" ada-select t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
88 ["Accept" ada-accept t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
89 ["Or accept" ada-or-accep t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
90 ["Or delay" ada-or-delay t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
91 ["Or terminate" ada-or-terminate t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
92 ["---" nil nil] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
93 ["Type" ada-type t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
94 ["Private" ada-private t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
95 ["Subtype" ada-subtype t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
96 ["Record" ada-record t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
97 ["Array" ada-array t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
98 ["----" nil nil] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
99 ["If" ada-if t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
100 ["Else" ada-else t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
101 ["Elsif" ada-elsif t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
102 ["Case" ada-case t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
103 ["-----" nil nil] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
104 ["While Loop" ada-while-loop t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
105 ["For Loop" ada-for-loop t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
106 ["Loop" ada-loop t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
107 ["------" nil nil] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
108 ["Exception" ada-exception t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
109 ["Exit" ada-exit t] |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
110 ["When" ada-when t]))) |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
111 (if ada-xemacs |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
112 (funcall (symbol-function 'add-submenu) |
44467
e34b692b2fa9
Menu changed from Statements to Templates.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
113 '("Ada") (append (list "Templates" |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
114 :included '(string= mode-name "Ada")) |
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
115 menu)) |
23868 | 116 |
44467
e34b692b2fa9
Menu changed from Statements to Templates.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
117 (define-key-after (lookup-key ada-mode-map [menu-bar Ada]) [Templates] |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
118 (list 'menu-item |
44467
e34b692b2fa9
Menu changed from Statements to Templates.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
119 "Templates" |
e34b692b2fa9
Menu changed from Statements to Templates.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
120 (easy-menu-create-menu "Templates" menu) |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
121 :visible '(string= mode-name "Ada")) |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
122 t)))) |
23868 | 123 |
124 | |
125 | |
126 | |
127 (defun ada-func-or-proc-name () | |
128 ;; Get the name of the current function or procedure." | |
129 (save-excursion | |
130 (let ((case-fold-search t)) | |
131 (if (re-search-backward ada-procedure-start-regexp nil t) | |
44467
e34b692b2fa9
Menu changed from Statements to Templates.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
132 (buffer-substring (match-beginning 3) (match-end 3)) |
23868 | 133 "NAME?")))) |
134 | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
135 (defvar ada-template-map |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
136 (let ((map (make-sparse-keymap))) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
137 (define-key map "h" 'ada-header) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
138 (define-key map "\C-a" 'ada-array) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
139 (define-key map "b" 'ada-exception-block) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
140 (define-key map "d" 'ada-declare-block) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
141 (define-key map "c" 'ada-case) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
142 (define-key map "\C-e" 'ada-elsif) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
143 (define-key map "e" 'ada-else) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
144 (define-key map "\C-k" 'ada-package-spec) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
145 (define-key map "k" 'ada-package-body) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
146 (define-key map "\C-p" 'ada-procedure-spec) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
147 (define-key map "p" 'ada-subprogram-body) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
148 (define-key map "\C-f" 'ada-function-spec) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
149 (define-key map "f" 'ada-for-loop) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
150 (define-key map "i" 'ada-if) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
151 (define-key map "l" 'ada-loop) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
152 (define-key map "\C-r" 'ada-record) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
153 (define-key map "\C-s" 'ada-subtype) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
154 (define-key map "S" 'ada-tabsize) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
155 (define-key map "\C-t" 'ada-task-spec) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
156 (define-key map "t" 'ada-task-body) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
157 (define-key map "\C-y" 'ada-type) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
158 (define-key map "\C-v" 'ada-private) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
159 (define-key map "u" 'ada-use) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
160 (define-key map "\C-u" 'ada-with) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
161 (define-key map "\C-w" 'ada-when) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
162 (define-key map "w" 'ada-while-loop) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
163 (define-key map "\C-x" 'ada-exception) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
164 (define-key map "x" 'ada-exit) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
165 map) |
23868 | 166 "Keymap used in Ada mode for smart template operations.") |
167 | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
168 (define-key ada-mode-map "\C-ct" ada-template-map) |
23868 | 169 |
170 ;;; ---- statement skeletons ------------------------------------------ | |
171 | |
172 (define-skeleton ada-array | |
26000 | 173 "Insert array type definition. |
26226
b63d041c9108
Changed format of years in copyright notices.
Gerd Moellmann <gerd@gnu.org>
parents:
26000
diff
changeset
|
174 Prompt for component type and index subtypes." |
23868 | 175 () |
176 "array (" ("index definition: " str ", " ) -2 ") of " _ ?\;) | |
177 | |
178 | |
179 (define-skeleton ada-case | |
26000 | 180 "Build skeleton case statement. |
181 Prompt for the selector expression. Also builds the first when clause." | |
23868 | 182 "[selector expression]: " |
183 "case " str " is" \n | |
184 > "when " ("discrete choice: " str " | ") -3 " =>" \n | |
185 > _ \n | |
186 < < "end case;") | |
187 | |
188 | |
189 (define-skeleton ada-when | |
190 "Start a case statement alternative with a when clause." | |
191 () | |
192 < "when " ("discrete choice: " str " | ") -3 " =>" \n | |
193 >) | |
194 | |
195 | |
196 (define-skeleton ada-declare-block | |
197 "Insert a block with a declare part. | |
198 Indent for the first declaration." | |
199 "[block name]: " | |
200 < str & ?: & \n | |
201 > "declare" \n | |
202 > _ \n | |
203 < "begin" \n | |
204 > \n | |
205 < "end " str | -1 ?\;) | |
206 | |
207 | |
208 (define-skeleton ada-exception-block | |
209 "Insert a block with an exception part. | |
210 Indent for the first line of code." | |
211 "[block name]: " | |
212 < str & ?: & \n | |
213 > "begin" \n | |
214 > _ \n | |
215 < "exception" \n | |
216 > \n | |
217 < "end " str | -1 ?\;) | |
218 | |
219 | |
220 (define-skeleton ada-exception | |
221 "Insert an indented exception part into a block." | |
222 () | |
223 < "exception" \n | |
224 >) | |
225 | |
226 | |
227 (define-skeleton ada-exit-1 | |
228 "Insert then exit condition of the exit statement, prompting for condition." | |
229 "[exit condition]: " | |
230 "when " str | -5) | |
231 | |
232 | |
233 (define-skeleton ada-exit | |
234 "Insert an exit statement, prompting for loop name and condition." | |
235 "[name of loop to exit]: " | |
44467
e34b692b2fa9
Menu changed from Statements to Templates.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
236 "exit " str & ?\ (ada-exit-1) | -1 ?\;) |
23868 | 237 |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
238 ;;;###autoload |
23868 | 239 (defun ada-header () |
240 "Insert a descriptive header at the top of the file." | |
241 (interactive "*") | |
242 (save-excursion | |
243 (goto-char (point-min)) | |
244 (if (fboundp 'make-header) | |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
245 (funcall (symbol-function 'make-header)) |
23868 | 246 (ada-header-tmpl)))) |
247 | |
248 | |
249 (define-skeleton ada-header-tmpl | |
250 "Insert a comment block containing the module title, author, etc." | |
251 "[Description]: " | |
252 "-- -*- Mode: Ada -*-" | |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
253 "\n" ada-fill-comment-prefix "Filename : " (buffer-name) |
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
254 "\n" ada-fill-comment-prefix "Description : " str |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
255 "\n" ada-fill-comment-prefix "Author : " (user-full-name) |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
256 "\n" ada-fill-comment-prefix "Created On : " (current-time-string) |
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
257 "\n" ada-fill-comment-prefix "Last Modified By: ." |
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
258 "\n" ada-fill-comment-prefix "Last Modified On: ." |
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
259 "\n" ada-fill-comment-prefix "Update Count : 0" |
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
260 "\n" ada-fill-comment-prefix "Status : Unknown, Use with caution!" |
23868 | 261 "\n") |
262 | |
263 | |
264 (define-skeleton ada-display-comment | |
265 "Inserts three comment lines, making a display comment." | |
266 () | |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
267 "--\n" ada-fill-comment-prefix _ "\n--") |
23868 | 268 |
269 | |
270 (define-skeleton ada-if | |
271 "Insert skeleton if statment, prompting for a boolean-expression." | |
272 "[condition]: " | |
273 "if " str " then" \n | |
274 > _ \n | |
275 < "end if;") | |
276 | |
277 | |
278 (define-skeleton ada-elsif | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
279 "Add an elsif clause to an if statement, |
23868 | 280 prompting for the boolean-expression." |
281 "[condition]: " | |
282 < "elsif " str " then" \n | |
283 >) | |
284 | |
285 | |
286 (define-skeleton ada-else | |
287 "Add an else clause inside an if-then-end-if clause." | |
288 () | |
289 < "else" \n | |
290 >) | |
291 | |
292 | |
293 (define-skeleton ada-loop | |
294 "Insert a skeleton loop statement. The exit statement is added by hand." | |
295 "[loop name]: " | |
296 < str & ?: & \n | |
297 > "loop" \n | |
298 > _ \n | |
299 < "end loop " str | -1 ?\;) | |
300 | |
301 | |
302 (define-skeleton ada-for-loop-prompt-variable | |
303 "Prompt for the loop variable." | |
304 "[loop variable]: " | |
305 str) | |
306 | |
307 | |
308 (define-skeleton ada-for-loop-prompt-range | |
309 "Prompt for the loop range." | |
310 "[loop range]: " | |
311 str) | |
312 | |
313 | |
314 (define-skeleton ada-for-loop | |
315 "Build a skeleton for-loop statement, prompting for the loop parameters." | |
316 "[loop name]: " | |
317 < str & ?: & \n | |
318 > "for " | |
319 (ada-for-loop-prompt-variable) | |
320 " in " | |
321 (ada-for-loop-prompt-range) | |
322 " loop" \n | |
323 > _ \n | |
324 < "end loop " str | -1 ?\;) | |
325 | |
326 | |
327 (define-skeleton ada-while-loop-prompt-entry-condition | |
328 "Prompt for the loop entry condition." | |
329 "[entry condition]: " | |
330 str) | |
331 | |
332 | |
333 (define-skeleton ada-while-loop | |
334 "Insert a skeleton while loop statement." | |
335 "[loop name]: " | |
336 < str & ?: & \n | |
337 > "while " | |
338 (ada-while-loop-prompt-entry-condition) | |
339 " loop" \n | |
340 > _ \n | |
341 < "end loop " str | -1 ?\;) | |
342 | |
343 | |
344 (define-skeleton ada-package-spec | |
345 "Insert a skeleton package specification." | |
346 "[package name]: " | |
347 "package " str " is" \n | |
348 > _ \n | |
349 < "end " str ?\;) | |
350 | |
351 | |
352 (define-skeleton ada-package-body | |
353 "Insert a skeleton package body -- includes a begin statement." | |
354 "[package name]: " | |
355 "package body " str " is" \n | |
356 > _ \n | |
357 ; < "begin" \n | |
358 < "end " str ?\;) | |
359 | |
360 | |
361 (define-skeleton ada-private | |
362 "Undent and start a private section of a package spec. Reindent." | |
363 () | |
364 < "private" \n | |
365 >) | |
366 | |
367 | |
368 (define-skeleton ada-function-spec-prompt-return | |
369 "Prompts for function result type." | |
370 "[result type]: " | |
371 str) | |
372 | |
373 | |
374 (define-skeleton ada-function-spec | |
375 "Insert a function specification. Prompts for name and arguments." | |
376 "[function name]: " | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
377 "function " str |
23868 | 378 " (" ("[parameter_specification]: " str "; " ) -2 ")" |
379 " return " | |
380 (ada-function-spec-prompt-return) | |
381 ";" \n ) | |
382 | |
383 | |
384 (define-skeleton ada-procedure-spec | |
385 "Insert a procedure specification, prompting for its name and arguments." | |
386 "[procedure name]: " | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
387 "procedure " str |
23868 | 388 " (" ("[parameter_specification]: " str "; " ) -2 ")" |
389 ";" \n ) | |
390 | |
391 | |
392 (define-skeleton ada-subprogram-body | |
393 "Insert frame for subprogram body. | |
394 Invoke right after `ada-function-spec' or `ada-procedure-spec'." | |
395 () | |
396 ;; Remove `;' from subprogram decl | |
397 (save-excursion | |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
398 (let ((pos (1+ (point)))) |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
399 (ada-search-ignore-string-comment ada-subprog-start-re t nil) |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
400 (when (ada-search-ignore-string-comment "(" nil pos t 'search-forward) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
401 (backward-char 1) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
402 (forward-sexp 1))) |
23868 | 403 (if (looking-at ";") |
404 (delete-char 1))) | |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
405 " is" \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
406 _ \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
407 < "begin" \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
408 \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
409 < "exception" \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
410 "when others => null;" \n |
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
411 < < "end " |
23868 | 412 (ada-func-or-proc-name) |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
413 ";" \n) |
23868 | 414 |
415 | |
416 (define-skeleton ada-separate | |
417 "Finish a body stub with `separate'." | |
418 () | |
419 > "separate;" \n | |
420 <) | |
421 | |
422 | |
423 ;(define-skeleton ada-with | |
424 ; "Inserts a with clause, prompting for the list of units depended upon." | |
425 ; "[list of units depended upon]: " | |
426 ; "with " str ?\;) | |
427 | |
428 ;(define-skeleton ada-use | |
429 ; "Inserts a use clause, prompting for the list of packages used." | |
430 ; "[list of packages used]: " | |
431 ; "use " str ?\;) | |
432 | |
433 | |
434 (define-skeleton ada-record | |
435 "Insert a skeleton record type declaration." | |
436 () | |
437 "record" \n | |
438 > _ \n | |
439 < "end record;") | |
440 | |
441 | |
442 (define-skeleton ada-subtype | |
443 "Start insertion of a subtype declaration, prompting for the subtype name." | |
444 "[subtype name]: " | |
445 "subtype " str " is " _ ?\; | |
446 (not (message "insert subtype indication."))) | |
447 | |
448 | |
449 (define-skeleton ada-type | |
450 "Start insertion of a type declaration, prompting for the type name." | |
451 "[type name]: " | |
452 "type " str ?\( | |
453 ("[discriminant specs]: " str " ") | |
454 | (backward-delete-char 1) | ?\) | |
455 " is " | |
456 (not (message "insert type definition."))) | |
457 | |
458 | |
459 (define-skeleton ada-task-body | |
460 "Insert a task body, prompting for the task name." | |
461 "[task name]: " | |
462 "task body " str " is\n" | |
463 "begin\n" | |
464 > _ \n | |
465 < "end " str ";" ) | |
466 | |
467 | |
468 (define-skeleton ada-task-spec | |
469 "Insert a task specification, prompting for the task name." | |
470 "[task name]: " | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
471 "task " str |
23868 | 472 " (" ("[discriminant]: " str "; ") ") is\n" |
473 > "entry " _ \n | |
474 <"end " str ";" ) | |
475 | |
476 | |
477 (define-skeleton ada-get-param1 | |
478 "Prompt for arguments and if any enclose them in brackets." | |
479 () | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
480 ("[parameter_specification]: " str "; " ) & -2 & ")") |
23868 | 481 |
482 | |
483 (define-skeleton ada-get-param | |
484 "Prompt for arguments and if any enclose them in brackets." | |
485 () | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
486 " (" |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
487 (ada-get-param1) | -2) |
23868 | 488 |
489 | |
490 (define-skeleton ada-entry | |
491 "Insert a task entry, prompting for the entry name." | |
492 "[entry name]: " | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
493 "entry " str |
23868 | 494 (ada-get-param) |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
495 ";" \n) |
23868 | 496 |
497 | |
498 (define-skeleton ada-entry-family-prompt-discriminant | |
499 "Insert a entry specification, prompting for the entry name." | |
500 "[discriminant name]: " | |
501 str) | |
502 | |
503 | |
504 (define-skeleton ada-entry-family | |
505 "Insert a entry specification, prompting for the entry name." | |
506 "[entry name]: " | |
507 "entry " str | |
508 " (" (ada-entry-family-prompt-discriminant) ")" | |
509 (ada-get-param) | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
510 ";" \n) |
23868 | 511 |
512 | |
513 (define-skeleton ada-select | |
514 "Insert a select block." | |
515 () | |
516 "select\n" | |
517 > _ \n | |
518 < "end select;") | |
519 | |
520 | |
521 (define-skeleton ada-accept-1 | |
522 "Insert a condition statement, prompting for the condition name." | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
523 "[condition]: " |
23868 | 524 "when " str | -5 ) |
525 | |
526 | |
527 (define-skeleton ada-accept-2 | |
528 "Insert an accept statement, prompting for the name and arguments." | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
529 "[accept name]: " |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
530 > "accept " str |
23868 | 531 (ada-get-param) |
532 " do" \n | |
533 > _ \n | |
534 < "end " str ";" ) | |
535 | |
536 | |
537 (define-skeleton ada-accept | |
538 "Insert an accept statement (prompt for condition, name and arguments)." | |
539 () | |
540 > (ada-accept-1) & " =>\n" | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
541 (ada-accept-2)) |
23868 | 542 |
543 | |
544 (define-skeleton ada-or-accept | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
545 "Insert an or statement, prompting for the condition name." |
23868 | 546 () |
547 < "or\n" | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
548 (ada-accept)) |
23868 | 549 |
550 | |
551 (define-skeleton ada-or-delay | |
552 "Insert a delay statement, prompting for the delay value." | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
553 "[delay value]: " |
23868 | 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 (defun ada-adjust-case-skeleton () | |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
566 "Adjust the case of the text inserted by a skeleton." |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
567 (save-excursion |
23868 | 568 (let ((aa-end (point))) |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
569 (ada-adjust-case-region |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
570 (progn (goto-char (symbol-value 'beg)) (forward-word -1) (point)) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
571 (goto-char aa-end))))) |
30409
a530830f8a3d
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Gerd Moellmann <gerd@gnu.org>
parents:
26226
diff
changeset
|
572 |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
573 (defun ada-stmt-mode-hook () |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
574 (set (make-local-variable 'skeleton-further-elements) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
575 '((< '(backward-delete-char-untabify |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
576 (min ada-indent (current-column)))))) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
577 (add-hook 'skeleton-end-hook |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
578 'ada-adjust-case-skeleton nil t) |
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
579 (ada-stmt-add-to-ada-menu)) |
23868 | 580 |
33823
d29063c1c480
(ada-template-map): Initialize and bind it to C-c t in ada-mode-map.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32301
diff
changeset
|
581 (add-hook 'ada-mode-hook 'ada-stmt-mode-hook) |
25902
92828b88cfcc
(ada-stmt-add-to-ada-menu): New function
Gerd Moellmann <gerd@gnu.org>
parents:
23869
diff
changeset
|
582 |
23868 | 583 (provide 'ada-stmt) |
584 | |
585 ;;; ada-stmt.el ends here |