use emacs functions

current-window-configuration and set-window-configuration do all the job!!