GNU Emacs Lisp Reference Manual
frame-list returns a list of all the frames that have not been deleted. It is analogous to buffer-list for buffers. The list that you get is newly created, so modifying the list doesn't have any effect on the internals of Emacs.next-frame lets you cycle conveniently through all the frames from an arbitrary starting point. It returns the ``next'' frame after frame in the cycle. If frame is omitted or nil, it defaults to the selected frame. The second argument, minibuf, says which frames to consider:
nilvisible0a windowanything elsenext-frame, but cycles through all frames in the opposite direction.See also next-window and previous-window, in Cyclic Window Ordering.