These are pointless questions; windows don't break.
Yes, there are functions called split-window ... but what they do is simply reduce the window size and create a new one in the freed space.
You cannot just use (= 1 (length (window-list))), since you have at least one window per frame (not counting the sim-windows of the minibuffer).
You may try:
(< (length (frame-list)) (length (window-list)))
but it doesnβt tell you if there are several windows in the selected frame, what are you really asking, since obviously it could be another frame containing several windows.
So, if you ask the question CORRECTLY, βhow can I find out if the selected frame contains more than one windowβ, you can easily find the answer:
(require 'cl) (defun complement (fun) (byte-compile `(lambda (&rest args) (not (apply ',fun args))))) (defun* more-than-one-window-in-frame-p (&optional (frame (selected-frame))) (< 1 (length (remove* frame (window-list) :key (function window-frame) :test (complement (function eql))))))
source share