]> code.delx.au - gnu-emacs-elpa/blobdiff - doc/snippet-development.org
Document $> and fix escaping
[gnu-emacs-elpa] / doc / snippet-development.org
index c4de86440fdfea2acf32ba53f946cf170e334789..c7924837686d85ae1ea97ec4412f793297884322 100644 (file)
@@ -6,14 +6,18 @@
 
 ** Quickly finding snippets
 
-There are some ways you can quickly find a snippet file:
+There are some ways you can quickly find a snippet file or create a new one:
 
 -  =M-x yas-new-snippet=
 
-   Prompts you for a snippet name, then tries to guess a suitable
-   directory to store it, prompting you for creation if it does not
-   exist. Finally, places you in a new buffer set to =snippet-mode= so
-   you can write your snippet.
+   Creates a new buffer with a template for making a new snippet.
+   The buffer is in =snippet-mode= (see below). When you are done
+   editing the new snippet, use =C-c C-c= to save it. This will
+   prompt for a directory two steps: first, the snippet table
+   (with a default based on the major mode you started in), and then
+   then snippet collection directory (defaults to the first directory
+   in =yas-snippet-dirs=. (See [[file:snippet-organization.org][Organizing Snippets]]
+   for more detail on how snippets are organized.)
 
 -  =M-x yas-find-snippets=
 
@@ -190,7 +194,7 @@ previous snippet.
 This is optional and has no effect whatsoever on snippet functionality,
 but it looks nice.
 
-* <<Template syntax>>
+* Template Syntax
 
 The syntax of the snippet template is simple but powerful, very similar
 to TextMate's.
@@ -258,10 +262,10 @@ like this:
 
 They acts as the default value for a tab stop. But when you firstly
 type at a tab stop, the default value will be replaced by your typing.
-The number can be omitted if you don't want to create [[mirrors]] or
-[[transformations]] for this field.
+The number can be omitted if you don't want to create [[mirrors-fields][mirrors]] or
+[[mirror-transformations][transformations]] for this field.
 
-** <<Mirrors>>
+** Mirrors <<mirrors-fields>>
 
 We refer the tab stops with placeholders as a /field/. A field can have
 mirrors. Its mirrors will get updated when you change the text of a
@@ -281,7 +285,7 @@ The tab stops with the same number to the field act as its mirrors. If
 none of the tab stops has an initial value, the first one is selected as
 the field and others mirrors.
 
-** Mirrors with <<transformations>>
+** Mirrors with transformations <<mirror-transformations>>
 
 If the value of an =${n:=-construct starts with and contains =$(=,
 then it is interpreted as a mirror for field =n= with a
@@ -418,3 +422,9 @@ the exit marker.
 By the way, =C-d= will only clear the field if you cursor is at the
 beginning of the field /and/ it hasn't been changed yet. Otherwise, it
 performs the normal Emacs =delete-char= command.
+
+** Indentation markers
+
+If [[sym:yas-indent-line][=yas-indent-line=]] is *not* set to '=auto=, it's still possible to
+indent specific lines by adding an indentation marker, =$>=, somewhere
+on the line.