11thHeaven
11thHeaven

Reputation: 379

Why do I suddenly have #'s around my python file?

I'm currently using emacs to write python files but every so often when I open my file folder I find that I have copies of the file but with #'s around them. For example, I'm working on a file called twist.py. For some reason I now appear to have something called #twist.py#, even though I never made a file with this name.

What does this mean and why does it happen?

Upvotes: 1

Views: 82

Answers (1)

KernelPanic
KernelPanic

Reputation: 600

#filename# files are auto-save files; effectively temporary backup files. Your #twist.py# file is likely there because you've been idle (not typing) for 30 seconds since you last saved twist.py, or you've typed 300 characters since your last save. (These are the defaults; the options are configurable with auto-save-timeout and auto-save-interval, respectively.) You can read more about this behaviour in the documentation.

If you don't like these files for whatever reason, they should disappear when you save the file manually. You can disable them entirely with:

(setq auto-save-default nil)

If you'd instead like them to be out of the way in the tmp directory, this blog post suggests an addition to .emacs:

(setq auto-save-file-name-transforms
      `((".*" ,temporary-file-directory t)))

Upvotes: 3

Related Questions