>> Your proposed window-state-change-functions would match window-state-get >> very well, e.g. it could call the hook with an argument containing alist >> of values that really changed, where elements of the alist could have >> the same keys as in alist returned from window-state-get, > > Retaining the nomenclature of 'window-state-get' is part of the plan. > But I'm not sure whether we want to retain all of what is recorded in > a window state. > >> for example: >> >> (add-hook 'window-state-change-functions (lambda (window alist) ...) nil t) >> >> where 'alist' could have such keys and values of changes: >> >> (buffer "*scratch*") - means the buffer was switched in the window > > (buffer . #) rather Here is a complete implementation that works well when tested on display-buffer-directionally in bug#32790 (it doesn't handle window-point because then the hook is called too often):