(Elisp) Yet Another Function To Save All File Buffers

(defun help/save-all-file-buffers ()
  "Saves every buffer associated with a file."
  (interactive)
  (dolist (buf (buffer-list))
    (with-current-buffer buf
      (when (and (buffer-file-name) (buffer-modified-p))
        (save-buffer)))))

Leave a Reply

Your email address will not be published. Required fields are marked *