I'm using some snippet I found from the internet.
And I encounter lots of error when using them.
for example,
printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);")
}$2${1:$(if (string-match "%" text) "\);" "")}
This is a printf snippet for c mode.
But it always gave me [yas] elisp error! Symbol's value as variable is void: text
So is there any bug in this piece of code or bug at somewhere else? If so, how can I debug it?
It seems that the snippet you are using was written for older versions of
yasnippet
because the variabletext
was renamed toyas-text
in newer versions, try replacingtext
withyas-text
in the snippet.I case you are not aware you can use
yas/tryout-snippet
to quickly try out snippets while editing them.