Skip to content

Instantly share code, notes, and snippets.

@pxlpnk
Created January 24, 2012 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pxlpnk/1670390 to your computer and use it in GitHub Desktop.
Save pxlpnk/1670390 to your computer and use it in GitHub Desktop.
function to revert all open buffers in emacs
(defun revert-all-buffers ()
"Refreshes all open buffers from their respective files"
(interactive)
(let* ((list (buffer-list))
(buffer (car list)))
(while buffer
(when (buffer-file-name buffer)
(set-buffer buffer)
(revert-buffer t t t))
(setq list (cdr list))
(setq buffer (car list))))
(message "Refreshing open files"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment