make insert state as close to emacs state as possible