Skip to content

How to save and restore the selected window in Emacs Lisp?

(save-selected-window
  (other-window 1)
  (insert "bar\n"))