I want to insert a specific yasnippet as part of a function in emacs-lisp. Is there a way to do that?
The only command that seems related is yas/insert-snippet, but it simply opens a popup with all the options and the documentation doesn’t say anything about bypassing the popup by specifing the snippet name.
yas/insert-snippetis indeed just a thin wrapper aroundyas/expand-snippetfor interactive use. However, the internal structures are… interesting. Judging from the source code the following does work for me when I want to expand the “defun” snippet in elisp-mode: