GNOME Bugzilla – Bug 452586
Snippets plugin syntax changed
Last modified: 2009-12-31 12:33:15 UTC
The snippets plugin syntax changed a bit and the docs should be updated accordingly. Changes: - Normal placeholders can have multiple default values. The first non-empty default value will be used as the default value. This is useful if you want to have a default value which is a environmental variable but fallback on a fixed default if the environmental variable isn't set. The syntax is: ${n:[def1,def2,...]}. So for example: ${1:[$GEDIT_SELECTED_TEXT,mytext]} - The syntax for python placeholder dependencies has changed. The dependencies can now be specified by using the following syntax: $<[n1,n2,...]: python code>. For example: $<[1,2]: return "example">. - Both shell and python placeholders can now have a tabstop, The syntax is: $(n:shell code), `n:shell code` and $<n:shell code> respectively. For python snippets this means that if you want to specify both a tabstop and dependencies than you need $<3:[1,2]: python code>. Tabstops in these placeholders are only valid when the placeholders don't have any dependencies (either implicit or explicit) on other placeholders - Escaping behaviour has changed. You now only need to escape characters that would be interpreted non literal if they weren't escaped. This means that many latex snippets will become much more readable. Things that need escaping are displaying placeholders ($1, ${1}, $< py >, $(shell)) -> (\$1, \${1}, \$< py >, \$(shell)), placeholder terminators such as }, >, ` and ) ($< py \> code >, $(shell \) code), `shell\` code`
*** This bug has been marked as a duplicate of bug 460523 ***