0

I am working on a file called hello.ml in Ocaml under emacs Taureg Merlin mode, and I realize there's file #hello.ml# (not hellocaml.ml~) in the same directory. I have only used the toplevel with #use "hello.ml" and called ocamlbuild during the time. The file #hello.ml# seems to be just a plain text snapshot of hello.ml at some point. I tried to update hello.ml and use #use in toplevel again, but #hello.ml# is not in sync with hello.ml. Does anyone have an idea where this file comes from?

Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254

1 Answers1

0

This is an auto-save file from Emacs. It only exists when you have unsaved changes in Emacs. Thanks to this file, in case your computer (or just Emacs) crashes with unsaved changes, Emacs can restore the unsaved changes when you restart and open the file again.

(I'm describing the default behavior, see the manual for how to configure it.)

Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254
  • So what's the difference between this file and `hello.ml~`? I thought it was the auto-save file that serves the purpose you said... –  Sep 30 '19 at 18:46
  • @kumom `hello.ml~` is a backup file. It's a previous version of the file from before the last time you saved. `#hello.ml#` is the current version from after the last time you saved. – Gilles 'SO- stop being evil' Sep 30 '19 at 18:53