Created
September 9, 2011 17:31
-
-
Save dbrady/1206823 to your computer and use it in GitHub Desktop.
reload-buffer
This file contains hidden or 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
; ---------------------------------------------------------------------- | |
; reload-buffer | |
; Seriously, why doesn't this already exist? Reloads the current | |
; buffer. find-alternate-file will sort of already do this; if you do | |
; not supply an argument to it it will reload the current | |
; buffer... but it will switch you to another buffer when it does | |
; it. All this function does is find-alt and then switch you back. | |
(defun reload-buffer() | |
(interactive) | |
(let ((buffername (buffer-name))) | |
(find-alternate-file buffername) | |
(switch-to-buffer buffername))) | |
; override the binding for find-alternate-file to be reload-buffer, | |
; since that's what I always use it for. | |
(global-set-key (kbd "\C-x C-v") 'reload-buffer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And M-x eval-buffer won't work in this instance?