> We could add overlays to every buffer, and whenever you change windows,Auto-adding the overlays can be done in window-configuration-change-hook.
> remove the overlay from the current buffer and add it back to the previous
> buffer.
We're talking about N overlays per buffer where N is small (it's number of
windows where the buffer is displayed), so there's no performance
problem there.
That would be a lot simpler, indeed, but I think it will be difficult
> Or, we could have it reversed. We could only have an overlay on the current
> buffer at any given time, and give it the window of (selected-window), and
> keep updating these any time you change buffers or windows.
to make it look good.
Stefan