test: split emacs functionality to its own file