I am writing a mode that implements a persistent horizontal window (very similar to the "persistence compile window" in ECB). While I did study the ECB code it is quite old and endeavored to work with even more ancient verions of emacs. I am trying to write code the makes use of the many recent enhancements to emacs' windowing system.
It would appear that display-buffer-base-action is exactly the point in display-buffer's processing sequence to hook in my window management smarts. I am able to classify newly created buffers base on buffer-name (e.g. Completions) and on whether of not they are related to a live process (using comint-check-proc). What I cannot do is classify a newly created buffer base on its ultimate major-mode. This is because when display-buffer is called on a newly created buffer that buffer's major-mode has not yet been set.
Is there any way to "peer into the future" to determine what major-mode will later get established?