After one starts using merlin to edit a file on Emacs under Windows it is not possible to move the containing directory around, which is quite inconvenient. Closing emacs does not solve the problem because the merlin process continues to run in the background. The only solution is to kill the merlin process running in the background.

- Why not shut down the
merlin background process when closing Emacs?
- Typically this problems happens because a program (Merlin in this case) keeps open handles to the directory or some file within it; if this is indeed the case, perhaps this situation can be avoided? For example even if one is editing a file in a directory with Emacs, that does not keep the containing directory from being renamed.
To reproduce
mkdir foo
emacs foo/foo.ml
- Perform some operation that invokes
merlin on the foo.ml buffer
mv foo foo2 in the terminal (fails)