1

I make some edits and press C-x C-s to save. Sometimes, out of blue emacs prompts this:

file has changed since visited or saved. Save anyway? (yes or no).

Even though I don't have the file open anywhere else, and I am sure nothing else has changed the file.

This happens rarely, only possible explanation would be that I press some combination as I bash buttons, and press save, that causes something weird. What could be the problem?

  • 1
    Have you tried lsof file (assuming nix system)? – wvxvw Dec 27 '14 at 16:02
3

Even though I don't have the file open anywhere else, and I am sure nothing else has changed the file.

You are probably mistaken about that.

E.g. if you sometimes create snapshot stashes with Magit then that would touch the affected files. Would you have expected that? After all it doesn't seem creating a snapshot should touch files in the working directory. Well it does because of limitations of git stash (by the way that's why the next release of Magit won't use git stash when creating stashes and instead re-implements some of its functionality in elisp).

If it's not that, then there are many other things that could touch the file behind your back.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.