> This looks promising. I attach a patch. Note that in my Emacs, window configurations are much more lightweight so I cannot reliably test it. You would have to do all the testing yourself. > One thing I don't understand is how to get > the previously visited file name from this list of four entries? But it's still there in the dead buffer (the only things that can get collected as long as a window is in a tab are the previous and next buffers shown in that window). Try the scenario below, using some suitable file as argument to 'find-file-noselect'. (defun foo (frame windows) (while windows (let* ((quad (car windows)) (window (car quad)) (buffer (find-file-noselect (buffer-file-name (nth 1 quad))))) (when buffer (set-window-buffer window buffer) (set-window-point window (nth 3 quad)) (set-window-start window (nth 2 quad) t))) (setq windows (cdr windows)))) (add-hook 'post-set-window-configuration-functions 'foo) (let ((window (selected-window)) (buffer (pop-to-buffer (find-file-noselect "..."))) (window-1 (split-window)) (window-2 (split-window nil nil t)) configuration) (set-window-point window-1 5000) (set-window-point window-2 10000) (setq configuration (current-window-configuration)) (y-or-n-p "Configuration saved ...") (delete-other-windows window) (kill-buffer buffer) (y-or-n-p "Configuration reset ...") (set-window-configuration configuration nil nil t) (message "Configuration restored")) Note that window point and start are stored as positions and not as markers which means that if you modify the buffer after the call of 'current-window-configuration', they may not be accurate any more. One could try to get their last position before the buffer was deleted but that would mean to give ‘marker-position’ an extra argument to omit the if (XMARKER (marker)->buffer) check with some "use at your own risk" caveats ('marker-buffer' at the same time would still have to return nil). martin