An Emacs inspired macro framework