In the manual, browse through the top level table of content. You're interested in windows, so go to the chapter on windows. Browse through its table of contents until you find “Saving and restoring the state of the screen”, which is the section window configurations. Now you know how Emacs calls what you're looking for and you know what functions are available.
(save-window-excursion
;; your code goes here
)
Furthermore, as noted in the documentation, there's a related macro save-selected-window
with similar usage but which does something slightly different.
(save-selected-window
;; your code goes here
)
save-window-excursion
saves the exact window arrangement (sizes, positions, displayed buffer) of the current frame only. save-selected-window
does not save window arrangements, but remembers which window is selected in each frame. Given what you want to do, which involves displaying (and therefore making room for) extra windows, I think save-window-excursion
is the right one.