Skip to content

Instantly share code, notes, and snippets.

@andyfriesen
Created February 7, 2014 19:03
Show Gist options
  • Save andyfriesen/8869502 to your computer and use it in GitHub Desktop.
Save andyfriesen/8869502 to your computer and use it in GitHub Desktop.
(defun revert-all-buffers ()
"Refreshes all open buffers from their respective files."
(interactive)
(dolist (buf (buffer-list))
(with-current-buffer buf
(when (and (buffer-file-name) (not (buffer-modified-p)))
(revert-buffer t t t) )))
(message "Refreshed open files.") )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment