1 ;; test.srt --- SRecode templates for testing
3 ;; Copyright (C) 2008-2018 Free Software Foundation, Inc.
5 ;; Author: Eric M. Ludlam <eric@siege-engine.com>
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 <https://www.gnu.org/licenses/>.
22 set mode "srecode-template-mode"
25 set application "tests"
27 set UTESTVAR1 ".SRT VAR 1"
29 ;; These are for testing features of template files.
35 $! This is a comment in the template. $
62 $#FIRST$;; I'm First$/FIRST$
63 $#NOTFIRST$;; I'm Not First$/NOTFIRST$
64 $#LAST$;; I'm Last$/LAST$
65 $#NOTLAST$;; I'm Not Last$/NOTLAST$
71 template wrapsomething :region
73 ;; Put this line in front:
75 ;; Put this line at the end:
78 template gapsomething :blank
80 ### ALL ALONE ON A LINE ###
84 "Insert text that has no newlines"
89 template includable :blank
91 ;; An includable $COMMENT$ we could use.
93 ;; Text after a point inserter.
96 template wrapinclude-basic
101 template wrapinclude-around
103 $<WI1:includable$Intermediate Comments$/WI1$
106 template complex-subdict
107 sectiondictionary "A"
110 set CPLX "I have a " macro "MYVAR1" " and a " macro "MYVAR2" "."
115 template wrap-new-template
116 sectiondictionary "NEWTMP"
117 set DOC "A nice doc string goes here."
119 $<NEWTMP:declaration:function$Random text in the new template
124 sectiondictionary "A"
126 sectiondictionary "A"
127 set MOOSE "VERY VERY LONG STRING THAT WILL BE CROPPED."
128 sectiondictionary "A"
130 sectiondictionary "A"
132 sectiondictionary "A"
136 Left Justified | Right Justified$#A$
137 $|MOOSE:20:right$ | $|MOOSE:20:left$$/A$
140 template custom-arg-handler :utest
141 sectiondictionary "A"
144 OUTSIDE SECTION: $UTESTVAR1$
145 INSIDE SECTION: $#A$$UTESTVAR1$$/A$