Guest User

Untitled

a guest
Jan 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. ; ----------------------------------------------------------------------
  2. ; reload-buffer
  3. ; Seriously, why doesn't this already exist? Reloads the current
  4. ; buffer. find-alternate-file will sort of already do this; if you do
  5. ; not supply an argument to it it will reload the current
  6. ; buffer... but it will switch you to another buffer when it does
  7. ; it. All this function does is find-alt and then switch you back.
  8. (defun reload-buffer()
  9. (interactive)
  10. (let ((buffername (buffer-name)))
  11. (find-alternate-file buffername)
  12. (switch-to-buffer buffername)))
  13.  
  14. ; override the binding for find-alternate-file to be reload-buffer,
  15. ; since that's what I always use it for.
  16. (global-set-key (kbd "\C-x C-v") 'reload-buffer)
Add Comment
Please, Sign In to add comment