How to create temporary files. # Filename` in `/ tmp`, not in the working directory

When the files are changed in the Emacs, a temporary file is created in the working directory, which is as follows: .#filename. The file is deleted when the buffer is saved.

I found several of these types of temporary files in my remote Git repositories, and I thought it would be better to pin the bud to the source instead of configuring Git to ignore them for each project.

How can we configure Emacs to create these files in a directory /tmpinstead of a working directory?

+4
source share
2 answers

- 24.3 Emacs, :

(setq create-lockfiles nil)

fooobar.com/questions/92561/...

+3

. auto-save-file-name-transforms , , . file.el /tmp. :

(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'" "/tmp/\\2" t))

/tmp temporary-file-directory. , /tmp. , auto-save-file-name-transforms (, , ), .

0

Source: https://habr.com/ru/post/1538227/


All Articles