0

I'm trying to do a snipped with default values being files in a directory, but fail. Seems calling elisp-code in yas-choose-value need special treatment?

I know you can hardcode it. something like

${1:file-name$(yas-choose-value '("foo" "bar"))}

But I want to call 'directory-files' which should return the list ("foo" "bar"). So, something like:

${1:file-name$(yas-choose-value `(directory-files ~/some/path)`}

But I get all kinds of errors doing that. Most often:

[yas] elisp error! Symbol's value as variable is void: YY(foo bar)...

Where do I go wrong?

1 Answers1

0

You need to use the elisp syntax for the substitution, not the shell one. Also, you were missing a closing paren.

${1:file-name$(yas-choose-value (directory-files ~/some/path))}
T. Verron
  • 228
  • 1
  • 7