emacs why do I have hashes at the ends of my file names i.e. #test.c#

Viewed 7619

I am using emacs 22.2.1 on Ubuntu 9.04.

Every time I open a file and work on it, and then when I list the files in the directory in the terminal I see hashes at the ends of each file.

i.e.

#test.c#
#test.h#

Why is this and how can I remove them?

Many thanks for any advice,

6 Answers

Instead of removing these autosave files, I recommend placing them in a hidden directory. They are cheap insurance against data loss.

On Emacs 28 running on Ubuntu linux, I have the following lines in my ~/.emacs config file:

(setq auto-save-file-name-transforms `((".", "~/.emacs-saves" t)))

Additionally, I use this to move the backup files (Those that look like filename~) as well:

(setq backup-directory-alist `(("." . "~/.emacs-saves")))
(setq backup-by-copying t)

Note that you might have a different config file location, this is perfectly fine. If you find ~/.emacs does not exist, then try ~/.emacs.el, ~/.emacs.d/init.el, or ~/.config/emacs/init.el.

Related