template editing mode for emacs