Tern hook for emacs