0
votes

I am trying to create a file named caseexp.sml . Emacs created a backup file of this file when I was working on it at some earlier point, and now when I try to open it as caseexp.sml, emacs opens a #caseexp.sml# file and everytime I try to save it using C-x C-w, emacs saves it as another backup file with another tilde added to its name. Several attempts later, I have only managed to save it as #caseexp.sml"~~~.

How can I avoid creating these "tilde" backup files and save my file simply as caseexp.sml ?

1

1 Answers

0
votes

There are a few unexpected behaviors here, so I can't be sure that this is what's going on, but usually what happens is that if files with hashes are left around, it's possible that Emacs crashed while you had unsaved changes. However, usually Emacs should prompt you to run "M-x recover-this-file" to restore changes from the unsaved-changes file (the filename with the hashes) to the actual file, so it's not clear what's going on there. Try fixing this from the command line.

You probably want to cp all the files to another location first, in order to have a backup (I'm assuming a Unix-like OS):

$ cp *caseexp* /tmp

Then delete the extra files while preserving the one with the most recent changes:

$ cp <most recent file with latest changes> caseexp.sml 
$ rm \#caseexp*