Yasnippet has a nice "run ... after exiting a snippet".
What I would like to do is include some visual effect after each ending snippet (changing background color for, say a second, or more sophisticated stuff).
I did this by switching background colors back and forth in that hook, but it's really short and not efficient, and also ugly.
However, how can this, or something similar be done with a timer?
Optional: Suggestions for fancy effects (including a timer) are welcome.
You can change the background once and then change it again 1 second later by using run-with-timer
:
(run-with-timer 1 nil 'my-fun)
where my-fun
does the action you want.