> And note one thing: When you call 'get-lru-window' twice in a row, it > will usually _not_ return a window it has internally considered as > "second best" provided it finds a best one. > > Consider a frame with three windows, one of them full width and the > other two, including the selected one, not full width. In this case > 'get-lru-window' will always return the full width window even if it has > a higher use time than the not selected, not full width one. A tentative solution for this and the other problems mentioned in this thread is in the attached diff. It should be able to digest the following form. (let* ((window (selected-window)) use-time) ;; Make window at bottom mru. (select-window (split-window)) ;; Make window on right mru. (select-window (split-window window nil t)) ;; Make initial window mru so the lru window is the one at bottom. (select-window window) (setq use-time (window-use-time)) (display-buffer (get-buffer-create "*foo*") `((display-buffer-use-least-recent-window) (window-min-width . full-width) (lru-time . ,use-time) )) (display-buffer (get-buffer-create "*bar*") `((display-buffer-use-least-recent-window) (window-min-width . full-width) (lru-time . ,use-time) ))) Note how it uses a non-full-width window for *bar* despite the fact that we would have preferred a full-width one. And note the settings of lru-time to the use time of the selected window before the first 'display-buffer' call. Commenting out these lru-time settings will make it use as window for *bar* the window it previously used for *foo*. martin