如何在`/ tmp`中创建临时文件`。filename',而不是工作目录 [英] How to create temporary files `.#filename` in `/tmp`, not working directory
问题描述
当在Emacs中修改文件时,工作目录中将创建一个临时文件,如下所示:。#filename
。当缓冲区被保存时,该文件被删除。
When files are being modified in Emacs, a temporary file is created in the working directory that looks like this: .#filename
. The file is deleted when the buffer is saved.
我在Git远程存储库中发现了这些类型的临时文件,我认为可能更好的是芽的来源,而不是配置的Git忽略他们对每一个项目。
I found a few of these types of temporary files in my Git remote repositories, and I thought it might be better to nip the bud at the source instead of configuring Git to ignore them for every project.
我们如何配置的Emacs的 / tmp目录创建这些文件
目录,而不是工作目录?
How can we configure Emacs to create those files in the /tmp
directory instead of the working directory?
推荐答案
在问题的文件称为锁文件 - 使用Emacs版本24.3开始,它可以用下面的设置来控制:
The file at issue is called a lock file -- commencing with Emacs version 24.3, it can be controlled with the following setting:
(setq create-lockfiles nil)
https://stackoverflow.com/a/12974060/2112489
这篇关于如何在`/ tmp`中创建临时文件`。filename',而不是工作目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!