srecode: User Templates
2 User Templates
****************
SRecode builds and maintains a map of all template files. The root
template files resides in the SRecode distribution. User written
templates files are saved in ‘~/.srecode’, along with the SRecode map
file.
-- Variable: srecode-map-save-file
The save location for SRecode’s map file.
Template files end with a ‘.srt’ extension. Details on how to write
templates are in Template Writing.
Each template file you write is dedicated to a single major mode. In
it, you can write templates within the same context and with the same
name as core templates. You can force your templates to override the
core templates for a particular major mode by setting the priority. See
Special Variables.
To get going quickly, open a new ‘.srt’ file. It will start in the
SRecode template writing mode. Use the SRecode minor mode menu to
insert the ‘empty’ file template.
When using templates in other modes (such as C++ or Emacs Lisp
templates), use the “Edit Template” menu to find a template you would
like to update. Copy it into your user template file, and change it.
If you were to update ‘declaration:function’ in your user template
file, then you would get this new template instead of the one that comes
with SRecode. Higher level applications should always use
‘declaration:function’ when generating their own code, so higher level
templates will then adopt your changes to ‘declaration:function’ into
themselves.
You can also override variables. Core variables are stored in the
SRecode root template file ‘default.srt’, and that contains the
copyright usually used, and some basic file setup formats. Override
variables like this by specifying a ‘mode’ of ‘default’ like this:
set mode "default"