@set TITLE SRecoder Manual
@set AUTHOR Eric M. Ludlam
@settitle @value{TITLE}
+@documentencoding UTF-8
@c Merge all indexes into a single index for now.
@c We can always separate them later into two or more as needed.
@c %**end of header
@copying
-Copyright @copyright{} 2007--2013 Free Software Foundation, Inc.
+Copyright @copyright{} 2007--2014 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@dircategory Emacs misc features
@direntry
-* SRecode: (srecode). Template code generator.
+* SRecode: (srecode). Semantic template code generator.
@end direntry
@titlepage
@center @titlefont{SRecode}
@vskip 0pt plus 1 fill
@center by @value{AUTHOR}
+@page
+@vskip 0pt plus 1filll
+@insertcopying
@end titlepage
@macro semantic{}
current buffer. Template files are sorted by priority, with user
templates being found first, and system level default templates last.
Templates are also sorted by application. Each application has its
-own templates, and are kept seperate from the generic templates.
+own templates, and are kept separate from the generic templates.
@section Dictionary
Dictionaries contain values associated with variable. Variables are
Some arguments are major-mode specific, such as the @code{:el} or
@code{:cpp} arguments.
-@refill
@section Template Insertion Context
A context can be provided for templates in a file. This helps
A context can be automatically derived as well based on the parsing
state from @i{Semantic}. @inforef{Top, Semantic Manual, semantic}.
-@refill
@section Applications
Commands that do a particular user task which involves also writing
By default, when inserting a template, if the user needs to enter text
to fill in a part of the template, then the minibuffer is used to
-query for that information. SRecode also supports a field-edting mode
+query for that information. SRecode also supports a field-editing mode
that can be used instead. To enable it set:
@defun srecode-insert-ask-variable-method
between editable fields in the template.
Once the cursor moves out of the are inserted by the template, all the
-fields are cancelled.
+fields are canceled.
@b{NOTE}: Some conveniences in templates, such as completion, or
-character restrictins are lost when using field editing mode.
+character restrictions are lost when using field editing mode.
@node Template Writing
@chapter Template Writing
@end example
Note that a VARIABLE is a name in a dictionary that can be used in a
-MACRO in a template. The macro referernces some variable by name.
+MACRO in a template. The macro references some variable by name.
@menu
* String Values:: Basic Variable values
@code{\n}, @code{\t}, and @code{\"} work.
When a string is inserted as part of a template, nothing within the
-string is interperted, such as template escape characters.
+string is interpreted, such as template escape characters.
@node Multi-string Values
@subsection Multi-string Values
priority that is set between SRecode base templates, and user defined
templates.
-Templates can be compiled via a project system, such as EDE. EDE
+Templates can be compiled via a project system, such as EDE@. EDE
loaded templates will get a @var{project} set automatically.
Example:
A template represents a text pattern that can be inserted into
a buffer.
-A basic template is declaired like this:
+A basic template is declared like this:
@example
template TEMPLATENAME :arg1 :arg2
@menu
* Template Section Dictionaries:: Template Scoped Macro values
-* Template Macros:: Macros occuring in template patterns
+* Template Macros:: Macros occurring in template patterns
@end menu
@node Template Section Dictionaries
@end example
In this example, the @var{NAME} variable gets the value ``foo'', but
-only while it is inside section macro A. The outer scoped NAME will
+only while it is inside section macro A@. The outer scoped NAME will
be empty.
This is particularly useful while using an include macro to pull in a
(if that section is not 'visible') or the section is shown one time
for each dictionary added to that symbol.
@xref{Developing Template Functions}.
-@refill
Macros prefixed with ``>'' will include another template. Include
macros would look like this:
@node Contexts
@section Context
-Each template belongs to a context. When promting for a template by
+Each template belongs to a context. When prompting for a template by
name, such as with @kbd{C-c / /}, the name is prefixed by the current
context. If there is no context, it defaults to @code{declaration}.
context C2
-temlate foo
+template foo
"Foo template in C2"
----
----
This is useful if there are multiple ways to declare something like a
function or variable that differ only by where it is in the syntax of
-the lanugage. The name @code{foo} is not ambiguous because each is in
+the language. The name @code{foo} is not ambiguous because each is in
a different context.
@node Prompts
@section Prompt
-Some templates use promtping macro insertion. A macro that needs a
+Some templates use prompting macro insertion. A macro that needs a
prompt looks like this:
@example
For such macros, you can pre-define prompts for any dictionary entry.
When that dictionary entry is first encountered, the user is prompted,
-and subsequent occurances of that dictionary entry use the same value.
+and subsequent occurrences of that dictionary entry use the same value.
To get a different prompt, use a prompt command like this:
prompt VARNAME "Varname: " defaultmacro "PREFIX"
@end example
-now, when it attempts to read in VARNAME, it will pre-populte the text
+now, when it attempts to read in VARNAME, it will pre-populate the text
editing section with whatever the value of PREFIX is.
Some language arguments may supply possible prefixes for prompts.
your dictionary values yourself. There are several utility functions
for this.
-In the simplest form, you can assocate a string with a variable.
+In the simplest form, you can associate a string with a variable.
@defun srecode-dictionary-set-value dict name value
@anchor{srecode-dictionary-set-value}
For each dictionary added to a variable, the block of codes in
the template will be repeated.
-If optional argument @var{SHOW-ONLY} is non-@code{nil}, then don't add a new dictionarly
-if there is already one in place. Also, don't add @var{FIRST}/@var{LAST} entries.
+If optional argument @var{SHOW-ONLY} is non-@code{nil}, then don't add
+a new dictionary if there is already one in place. Also, don't add
+@var{FIRST}/@var{LAST} entries.
These entries are not needed when we are just showing a section.
Each dictionary added will automatically get values for positional macros
@node Querying a Dictionary
@section Querying a Dictionary
-When creating a new argument, it may be useful to ask the dicitonary
+When creating a new argument, it may be useful to ask the dictionary
what entries are already set there, and conditionally create new
entries based on those.
@item HOUR12
The current hour in 12 hour format.
@item AMPM
-Locale equivalent of AM or PM. Usefule with HOUR12.
+Locale equivalent of AM or PM@. Useful with HOUR12.
@item MINUTE
The current minute.
@item SECOND
@table @code
@item ARGS
-A Loop macro value. Each argument is inserted in ARGS. To create a
+A Loop macro value. Each argument is inserted in ARGS@. To create a
comma separated list of arguments, you might do this:
@example
Converts the filename into text that would be suitable as a class-name
for the main class in the file.
@item CURRENT_PACKAGE
-Finds the occurance of ``package'' and gets its value.
+Finds the occurrence of ``package'' and gets its value.
@end table
@subsubsection Argument :el
The name of the Emacs Custom group that instances of @code{defcustom}
ought to use.
@item FACEGROUP
-The name of the Emacs Custom group that faces delcared with
+The name of the Emacs Custom group that faces declared with
@code{defface} ought to use.
@end table
@end defun
For purposes of an @srecode{} application, it is important to decide
-what to call yoru application, and use that with this method call.
+what to call your application, and use that with this method call.
@section Creating dictionaries
@node Template Naming Conventions
@chapter Template Naming Conventions
-For @srecode{} to work across langauges reliably, templates need to
+For @srecode{} to work across languages reliably, templates need to
follow a predictable pattern. For every language of similar nature
(OO, functional, doc based) if they all provide the same base
templates, then an application can be written against the base
@item function
A standalone function. Not a method, external method, or other.
@item method
-A method belonging to some class declaired outside the textual bounds
+A method belonging to some class declared outside the textual bounds
of that class' declaration.
@item variable
A global variable.
@table @var
@item TAG
-A special insertion value TAG. You can use semantic functions to turn
+A special insertion value TAG@. You can use semantic functions to turn
the tag into a string.
@item HAVEDEFAULT
@itemx DEFAULT