Skip to content

How to insert strings in a given buffer in Emacs Lisp?

(with-current-buffer (get-buffer-create "*foo*")
  (erase-buffer)
  (insert "foo"))