VINT64
VINT64

Reputation: 153

Emacs: trying to write something after saving provokes message "file changed on disk. Really edit the buffer?"

Emacs 24 in Ubuntu 14. I have file opened only in emacs, and it gives me this constantly, after each saving. that is annoying. This is strange, because earlier everything worked fine. I can hardly guess what could I break during this time. I'am total newbie in Ubuntu, using it according to instructions found in internet. Now I'm using emacs 23, everything is fine. I guess, I need auto-syncronization of opened buffer with saved file right after saving. Anyway, how can I fix it?

Upvotes: 1

Views: 160

Answers (2)

maxy
maxy

Reputation: 5467

A workaround try M-x global-auto-revert-mode. It will only auto-revert if you have no local modification since the last saving. This is generally a nice mode to turn on if you use multiple editors, and I keep it enabled all the time.

Other ideas:

  1. Check if any other process currently has the file open using fuser /path/to/filename.txt (note: it only shows open file descriptors, not processes that hold the file content in memory and write it later)
  2. Do you use any non-standard filesystem? (check with df -h /path/to/filename.txt and mount)
  3. Is your system time stable? (Manually check date, scan the output of dmesg for obvious errors concerning timekeeping, and look for errors related to NTP in the logfiles in /var/log/.

Upvotes: 1

db48x
db48x

Reputation: 3178

It sounds like some other program on your computer is reading the file when it changes, and possibly even introducing changes (perhaps just to the modification time, rather than to the contents). It's hard to say off-hand just what that would be.

Upvotes: 1

Related Questions