While working on info.el I needed a function to return info windows on all frames. I was a bit surprised to discover there is no built-in option in window-list or elsewhere as far as I can see to get all windows for all frames, or a filtered list containing interesting windows for all frames. I ended up with this: #+begin_src emacs-lisp (defun window-list-by-mode (mode &optional all-frames) "Return list of windows displaying buffers whose major mode is MODE. If ALL-FRAMES is non-nil, consider all frames, otherwise just selected frame." (mapcar (lambda (window) (cons (prin1-to-string window) window)) (cl-remove-if-not (lambda (window) (with-current-buffer (window-buffer window) (eq major-mode mode))) (if all-frames (apply #'nconc (mapcar (lambda (f) (window-list f)) (frame-list))) (window-list))))) #+end_src Anyway, looking at window.c, I can see that window_candidate_p actually does consider windows on all frames, but 't option is never passed through from window-list. To save gymnastics via apply and nconc and doing the double work, I have patched window-list function to let 't option further and documented the change. It seems to me that it works as intended. I have tested myself, I hope I haven't missed some possible case, but I'm a little suspisious: what was the reason why this wasn't documented and used? I mean, it is already there, but cut-off for some reason?