Update copyright year to 2014 by running admin/update-copyright.
[emacs.git] / etc / srecode / template.srt
blob67615bcab98e42bca17a0d088e04b671caab6ff5
1 ;;; template.srt --- Templates for Semantic Recoders
3 ;; Copyright (C) 2005, 2007-2014 Free Software Foundation, Inc.
5 ;; Author: Eric Ludlam <zappo@gnu.org>
7 ;; This file is part of GNU Emacs.
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.
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.
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/>.
22 set escape_start "$"
23 set escape_end "$"
24 set mode "srecode-template-mode"
25 set priority "70"
27 set comment_start  ";;"
28 set comment_end    ""
29 set comment_prefix ";;"
31 set SEPARATOR "----"
33 set DOLLAR "$"
35 context file
37 prompt MAJORMODE "Major Mode for templates: " read srecode-read-major-mode-name
38 prompt START "Escape Start Characters: " default "{{"
39 prompt END "Escape End Characters: " default "}}"
41 template empty :file :user :time :srt
42 "Insert a skeleton for a template file."
43 ----
44 $>:filecomment$
46 set mode "$?MAJORMODE$"
47 set escape_start "$?START$"
48 set escape_end "$?END$"
50 context file
52 $^$
55 ;; end
56 ----
58 template mode-basics :srt
59 "Fill out a full template including parts for basic new mode stuff."
60 sectiondictionary "E"
61 set NAME "empty :file :user :time"
62 set DOC "Fill out an empty file."
63 set KEY "e"
64 sectiondictionary "C1"
65 set NAME "declaration"
66 sectiondictionary "DTF"
67 set NAME "function :blank :indent"
68 set DOC "Template to declare a function."
69 set KEY "f"
70 sectiondictionary "DTV"
71 set NAME "variable :blank :indent"
72 set DOC "Template to declare a variable."
73 set KEY "v"
74 sectiondictionary "PR"
75 set NAME "NAME"
76 set PROMPT "Name for declaration: "
77 ----
78 $>:declaration:commentchars$
80 $<E:declaration:function$
81 $ESCAPE_START$>:filecomment$ESCAPE_END$
82 $/E$
84 $>C1:declaration:context$
86 $>PR:declaration:prompt$
88 $>DTF:declaration:function$
89 $>DTV:declaration:function$
90 ----
91 bind "m"
94 context declaration
96 prompt NAME "Name of new template: "
97 prompt KEY "Key Binding: " read read-char
99 template function :blank
100 "Insert a template block for Srecoder templates."
101 ----
102 template $?NAME$$#ARG$$NAME$$/ARG$
103 "$DOC$"
104 $SEPARATOR$
106 $SEPARATOR$
107 bind "$?KEY$"
108 ----
109 bind "f"
111 prompt NAME "Name of new variable: "
113 template variable :blank
114 "Inert a variable."
115 ----
116 set $?NAME$ "$^$"
117 ----
118 bind "v"
120 template prompt :blank
121 "Insert a prompt."
122 ----
123 prompt $?NAME$ "$?PROMPT$"
124 ----
125 bind "p"
127 template priority :blank
128 "Insert a priority statement."
129 ----
130 set priority $^$
131 ----
133 template application :blank
134 "Insert an application statement."
135 ----
136 set application "$^$"
137 ----
139 template context :blank
140 "Insert a context statement."
141 ----
142 context $NAME$
143 ----
144 bind "c"
146 template commentchars :blank
147 "Insert the variables for handling comments."
148 ----
149 set comment_start  ""
150 set comment_end    ""
151 set comment_prefix ""
152 ----
154 context code
156 prompt NAME "Name of variable: " read srecode-read-variable-name
158 template variable :srt
159 "Insert a variable with completion from the current file."
160 ----
161 $ESCAPE_START$$?NAME$$ESCAPE_END$
162 ----
163 bind "v"
165 prompt NAME "Name of macro: "
167 template ask :srt
168 "Insert a prompting variable."
169 ----
170 $ESCAPE_START$?$?NAME$$ESCAPE_END$
171 ----
172 bind "a"
174 template comment :srt
175 ----
176 $ESCAPE_START$!$^$$ESCAPE_END$
177 ----
178 bind "c"
180 prompt TEMPLATE "Template to include: " read srecode-read-template-name
182 template include :srt
183 ----
184 $ESCAPE_START$>:$?TEMPLATE$$ESCAPE_END$
185 ----
186 bind "i"
188 template includewrap :srt
189 ----
190 $ESCAPE_START$<:$?TEMPLATE$$ESCAPE_END$$^$$ESCAPE_START$/$NAME$$ESCAPE_END$
191 ----
192 bind "w"
194 template point :srt
195 ----
196 $ESCAPE_START$^$ESCAPE_END$
197 ----
198 bind "p"
200 template section :srt
201 "Insert a section, or looping construct."
202 ----
203 $ESCAPE_START$#$?NAME$$ESCAPE_END$
205 $ESCAPE_START$/$NAME$$ESCAPE_END$
206 ----
207 bind "s"
209 template escape-start-quoted :srt
210 "Escape Start"
211 ----
212 $ESCAPE_START$ESCAPE_START$ESCAPE_END$
213 ----
214 bind "q"
216 template escape-end-quoted :srt
217 "Escape Start"
218 ----
219 $ESCAPE_START$ESCAPE_END$ESCAPE_END$
220 ----
221 bind "e"
224 ;; end