>> We need a way to bump the time stamp of _any_ window used. > > Sorry, I don't understand what that means in practice. Specifically, > what do you mean by "any window used"? used by whom and under what > circumstances? or do you mean any window that is currently displayed > on all the frames? I mean "any window used" by 'display-buffer' to display a buffer. >> Otherwise, >> the various action functions will continue to fight each other. Lars >> wanted to go the way XEmacs did but stopped in the middle. And XEmacs >> uses >> >> (if (window-buffer window) >> (save-excursion >> (save-selected-window >> (select-window window) >> (record-buffer (window-buffer window))))) >> >> to bump the use time of every window used by 'display-buffer'. > > You mean, do this every time display-buffer is called and selects some > window? But that would change our behavior for all the callers of > display-buffer, whose names is a legion. Whereas the intent was to > provide an optional feature that hopefully doesn't affect any existing > behaviors. It would change the behavior iff a user or caller had added a non-nil 'bump-time-stamp' entry to the alist. Existing behaviors would not be affected. I'll give you an example. Apply the attached bump-use-time.diff. Now with emacs -Q evaluate: (let* ((window-combination-resize t)) (split-window) (split-window) (display-buffer (get-buffer-create "*foo*")) (display-buffer (get-buffer-create "*bar*"))) *foo* is nowhere displayed because 'display-buffer' displayed *bar* in the least recently used window instead. This is the behavior Lars wanted to avoid. Now instead do (let* ((window-combination-resize t)) (split-window) (split-window) (display-buffer (get-buffer-create "*foo*") '(nil (bump-use-time . t))) (display-buffer (get-buffer-create "*bar*") '(nil (bump-use-time . t)))) This is the behavior Lars wanted. Look, no separate action function needed at all. If anyone has a solution to that problem that's simpler than this two-liner, I'll be all ears. >> > Would it work to just temporarily select the window inside >> > display-buffer-use-least-recent-window, so that its use time is bumped >> > without any sneaky primitives? Then we could remove >> > window-bump-use-time. >> >> As Lars conceived it, independent 'display-buffer' calls should be able >> to build on previous ones. Otherwise, we could write a function like >> 'display-many-buffers-at-once', within that function mark all windows >> used as temporarily dedicated to their buffers, and at the end restore >> the previous dedicated states of these windows. Obviously, a function >> like 'display-many-buffers-at-once' would not qualify as buffer display >> action function. > > What do you mean by "independent calls"? Or what are "dependent > calls" for this purpose? Without understanding that, I cannot see how > what you wrote here answers my question, sorry. A dependent call would be one inside a function like 'display-many-buffers-at-once' where you want to avoid that the same window is used for displaying first one and then another buffer. Any other calls would be independent. But to return to your question "Would it work to just temporarily select the window inside display-buffer-use-least-recent-window, so that its use time is bumped without any sneaky primitives?". The XEmacs solution cited above does precisely that and that's why I posted it here. Why you would call a primitive like 'window-bump-use-time' "sneaky" is beyond my comprehension. Is it because I originally proposed it? martin