Created
January 24, 2012 14:18
-
-
Save pxlpnk/1670390 to your computer and use it in GitHub Desktop.
function to revert all open buffers in emacs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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