minibuffer

How to modify the content of a file in Emacs Lisp?

October 10, 2023
(let ((buff (find-file-noselect "./foo")))
  (with-current-buffer buff
    (goto-char (point-min))
    (insert "foo\n")
    (goto-char (point-max))
    (insert "bar\n")
    (save-buffer))
  (kill-buffer buff))