I stumbled upon this feature for functions, and was eager to try it out.
However, I ran into an error message, after trying the snippet in python-mode:
[yas] elisp error: Symbol’s value as variable is void: text
From what I read on his blog, and seeing the others trying this snippet, it went propably without any problems for them. I couldn't figure out how I could bind any value to the text. Any suggestion?
text
is that it is referring to. Post some of that code and it should be easy to help you. Looking at the page you cite, and searching fortext
, this part of the code seems problematic, as variabletext
in it indeed looks like a free variable:(mapcar '(lambda (x) (split-string x "=")) (split-string text ","))
. Try settingdebug-on-error
tot
and showing a backtrace.de
, as displayed on that page. The variable text is indeed not defined yet, as the backtrace told me. So it seems the author didn't delivered a working example of the source code. But I thought it was only me. You ran into an error too, I assume?debug-on-error
toggled tot
, I didn't get any backtrace when the error occured. I got only that error message inside the yasnippet. Because the error occured when Yasnippet tried to interpret the snippet, and not Emacs, I guess.