Eli Zaretskii writes: > Hmm... but now I see that the previous code already renamed the file > with the new data after the new data was completely written, is that > right? If so, I don't think this last change will help, and we need > to understand how come rename-file doesn't already solve this problem. Yes, it is right. You suggested using write to temporary file -> rename method earlier and I implemented it. > Is the file being read and written a regular file or a symlink? Regular file. > One thing to try is to let-bind write-region-inhibit-fsync to a nil > value around the code which writes the data to the org-persist file. > Maybe we have some tricky race condition between the filesystem > flushing its buffer after one instance of Emacs wrote the file, and > the other instance of Emacs that opens the file for reading. The attached diff does it. Need to test.