ems function should also use tty emacs