* etc/MACHINES: Misc small edits.
[bpt/emacs.git] / etc / srecode / template.srt
CommitLineData
c05676c5
CY
1;;; template.srt --- Templates for Semantic Recoders
2
ba318903 3;; Copyright (C) 2005, 2007-2014 Free Software Foundation, Inc.
c05676c5
CY
4
5;; Author: Eric Ludlam <zappo@gnu.org>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set escape_start "$"
23set escape_end "$"
24set mode "srecode-template-mode"
25set priority "70"
26
27set comment_start ";;"
28set comment_end ""
29set comment_prefix ";;"
30
31set SEPARATOR "----"
32
33set DOLLAR "$"
34
35context file
36
37prompt MAJORMODE "Major Mode for templates: " read srecode-read-major-mode-name
38prompt START "Escape Start Characters: " default "{{"
39prompt END "Escape End Characters: " default "}}"
40
41template empty :file :user :time :srt
42"Insert a skeleton for a template file."
43----
44$>:filecomment$
45
46set mode "$?MAJORMODE$"
47set escape_start "$?START$"
48set escape_end "$?END$"
49
50context file
51
52$^$
53
54
55;; end
56----
57
58template mode-basics :srt
59"Fill out a full template including parts for basic new mode stuff."
60sectiondictionary "E"
61set NAME "empty :file :user :time"
62set DOC "Fill out an empty file."
63set KEY "e"
64sectiondictionary "C1"
65set NAME "declaration"
66sectiondictionary "DTF"
67set NAME "function :blank :indent"
68set DOC "Template to declare a function."
69set KEY "f"
70sectiondictionary "DTV"
71set NAME "variable :blank :indent"
72set DOC "Template to declare a variable."
73set KEY "v"
74sectiondictionary "PR"
75set NAME "NAME"
76set PROMPT "Name for declaration: "
77----
78$>:declaration:commentchars$
79
80$<E:declaration:function$
81$ESCAPE_START$>:filecomment$ESCAPE_END$
82$/E$
83
84$>C1:declaration:context$
85
86$>PR:declaration:prompt$
87
88$>DTF:declaration:function$
89$>DTV:declaration:function$
90----
91bind "m"
92
93
94context declaration
95
96prompt NAME "Name of new template: "
97prompt KEY "Key Binding: " read read-char
98
99template function :blank
100"Insert a template block for Srecoder templates."
101----
102template $?NAME$$#ARG$$NAME$$/ARG$
103"$DOC$"
104$SEPARATOR$
105$^$
106$SEPARATOR$
107bind "$?KEY$"
108----
109bind "f"
110
111prompt NAME "Name of new variable: "
112
113template variable :blank
114"Inert a variable."
115----
116set $?NAME$ "$^$"
117----
118bind "v"
119
120template prompt :blank
121"Insert a prompt."
122----
123prompt $?NAME$ "$?PROMPT$"
124----
125bind "p"
126
127template priority :blank
c80e3b4a 128"Insert a priority statement."
c05676c5
CY
129----
130set priority $^$
131----
132
133template application :blank
c80e3b4a 134"Insert an application statement."
c05676c5
CY
135----
136set application "$^$"
137----
138
139template context :blank
140"Insert a context statement."
141----
142context $NAME$
143----
144bind "c"
145
146template commentchars :blank
147"Insert the variables for handling comments."
148----
149set comment_start ""
150set comment_end ""
151set comment_prefix ""
152----
153
154context code
155
156prompt NAME "Name of variable: " read srecode-read-variable-name
157
158template variable :srt
159"Insert a variable with completion from the current file."
160----
161$ESCAPE_START$$?NAME$$ESCAPE_END$
162----
163bind "v"
164
165prompt NAME "Name of macro: "
166
167template ask :srt
168"Insert a prompting variable."
169----
170$ESCAPE_START$?$?NAME$$ESCAPE_END$
171----
172bind "a"
173
174template comment :srt
175----
176$ESCAPE_START$!$^$$ESCAPE_END$
177----
178bind "c"
179
180prompt TEMPLATE "Template to include: " read srecode-read-template-name
181
182template include :srt
183----
184$ESCAPE_START$>:$?TEMPLATE$$ESCAPE_END$
185----
186bind "i"
187
188template includewrap :srt
189----
190$ESCAPE_START$<:$?TEMPLATE$$ESCAPE_END$$^$$ESCAPE_START$/$NAME$$ESCAPE_END$
191----
192bind "w"
193
194template point :srt
195----
196$ESCAPE_START$^$ESCAPE_END$
197----
198bind "p"
199
200template section :srt
201"Insert a section, or looping construct."
202----
203$ESCAPE_START$#$?NAME$$ESCAPE_END$
204$^$
205$ESCAPE_START$/$NAME$$ESCAPE_END$
206----
207bind "s"
208
209template escape-start-quoted :srt
210"Escape Start"
211----
212$ESCAPE_START$ESCAPE_START$ESCAPE_END$
213----
214bind "q"
215
216template escape-end-quoted :srt
217"Escape Start"
218----
219$ESCAPE_START$ESCAPE_END$ESCAPE_END$
220----
221bind "e"
222
223
224;; end