I’m trying to make a yasnippet with this function
\cite{${1:label$(unless yas/modified-p (reftex-citation nil 'dont-insert))}}$0
work but when I run it I get
[yas] elisp error!
The strange thing is that I have equivalent snippets but with reftex-reference instead of reftex-citation that runs fine.
I think you have a typo in your snippet. The first argument, not the second, of
reftex-citationisNO-INSERT. So I think it should be:Regardless, either way works for me. When I was testing it, I got an error
so that might be your problem. Can you run
reftex-citationvia C-c [ in the document?