Emacs:如何禁用“磁盘上的文件更改”检查? [英] Emacs: how to disable 'file changed on disk' checking?

查看:82
本文介绍了Emacs:如何禁用“磁盘上的文件更改”检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案

Emacs真的试图帮助你这里。请阅读防止同时编辑的信息页面。



但是,如果您还想避免该消息/提示,可以重新定义正在执行提示的功能:

 (defun ask-user-about-supersession-threat(fn)
公然忽略在磁盘上更改的文件

(defun ask-user-about-lock(文件对手)
总是抓住锁
t)

当两个人使用Emacs来编辑同一个文件时,第二个功能就是提供一个类似的提示(但不是你在问题中看到的那个)。



我建议不要超越这两个例程,但是如果你愿意的话,它会在那里。





关闭机会 global-auto-revert-mode 已启用,您可以禁用该功能。将其添加到您的.emacs中:

 (全局自动恢复模式-1)

您可以通过查看相同名称的变量来判断模式是否开启:

  Ch v global-auto-revert-mode RET 

如果值为 t ,则模式为开启,否则为关闭。


How to disable Emacs from checking the buffer file was changed outside the editor?

解决方案

Emacs is really trying to help you here. Read the info page on Protection against Simultaneous Editing.

But, if you still want to avoid that message/prompt, you can redefine the function that is doing the prompting:

(defun ask-user-about-supersession-threat (fn)
  "blatantly ignore files that changed on disk"
  )
(defun ask-user-about-lock (file opponent)
  "always grab lock"
   t)

The second function there is for when two people are using Emacs to edit the same file, and would provide a similar prompt (but not the one you seemed to refer to in the question).

I'd advise against overriding the two routines, but it's there if you want.


On the off chance global-auto-revert-mode is on, you could disable that. Add this to your .emacs:

(global-auto-revert-mode -1)

You can tell if the mode is on by looking at the variable of the same name:

C-h v global-auto-revert-mode RET

If the value is t, then the mode is on, otherwise it is off.

这篇关于Emacs:如何禁用“磁盘上的文件更改”检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆