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/>.
24 set mode "srecode-template-mode"
27 set comment_start ";;"
29 set comment_prefix ";;"
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."
46 set mode "$?MAJORMODE$"
47 set escape_start "$?START$"
48 set escape_end "$?END$"
58 template mode-basics :srt
59 "Fill out a full template including parts for basic new mode stuff."
61 set NAME "empty :file :user :time"
62 set DOC "Fill out an empty file."
64 sectiondictionary "C1"
65 set NAME "declaration"
66 sectiondictionary "DTF"
67 set NAME "function :blank :indent"
68 set DOC "Template to declare a function."
70 sectiondictionary "DTV"
71 set NAME "variable :blank :indent"
72 set DOC "Template to declare a variable."
74 sectiondictionary "PR"
76 set PROMPT "Name for declaration: "
78 $>:declaration:commentchars$
80 $<E:declaration:function$
81 $ESCAPE_START$>:filecomment$ESCAPE_END$
84 $>C1:declaration:context$
86 $>PR:declaration:prompt$
88 $>DTF:declaration:function$
89 $>DTV:declaration:function$
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."
102 template $?NAME$$#ARG$$NAME$$/ARG$
111 prompt NAME "Name of new variable: "
113 template variable :blank
120 template prompt :blank
123 prompt $?NAME$ "$?PROMPT$"
127 template priority :blank
128 "Insert a priority statement."
133 template application :blank
134 "Insert an application statement."
136 set application "$^$"
139 template context :blank
140 "Insert a context statement."
146 template commentchars :blank
147 "Insert the variables for handling comments."
151 set comment_prefix ""
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."
161 $ESCAPE_START$$?NAME$$ESCAPE_END$
165 prompt NAME "Name of macro: "
168 "Insert a prompting variable."
170 $ESCAPE_START$?$?NAME$$ESCAPE_END$
174 template comment :srt
176 $ESCAPE_START$!$^$$ESCAPE_END$
180 prompt TEMPLATE "Template to include: " read srecode-read-template-name
182 template include :srt
184 $ESCAPE_START$>:$?TEMPLATE$$ESCAPE_END$
188 template includewrap :srt
190 $ESCAPE_START$<:$?TEMPLATE$$ESCAPE_END$$^$$ESCAPE_START$/$NAME$$ESCAPE_END$
196 $ESCAPE_START$^$ESCAPE_END$
200 template section :srt
201 "Insert a section, or looping construct."
203 $ESCAPE_START$#$?NAME$$ESCAPE_END$
205 $ESCAPE_START$/$NAME$$ESCAPE_END$
209 template escape-start-quoted :srt
212 $ESCAPE_START$ESCAPE_START$ESCAPE_END$
216 template escape-end-quoted :srt
219 $ESCAPE_START$ESCAPE_END$ESCAPE_END$