M BUZZ CRAZE NEWS
// news

Safely reload files which are changed on disc

By David Jones

I often perform the following workflow:

  1. Save file I am working on
  2. Do 'svn update', which pulls update from server and merges in my changes
  3. Go back into emacs

At this point emacs tells me the file has changed on disc (true), and lets me choose between abandoning my changes, or saving the file I have edited.

I want emacs to automatically reload, but only when I have made no changes to the buffer since I last saved. Is that possible? Alternatively, just give me a way of finding out if I have made any changes since I last saved, as a sanity check.

1

1 Answer

Should work if you put this in your .emacs:

(global-auto-revert-mode 1)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy