Emacs:如何禁用 'file changed on disk' 检查?

标签 emacs

如何禁止 Emacs 检查编辑器外部的缓冲区文件是否已更改?

最佳答案

Emacs 真的很想为您提供帮助。阅读 Protection against Simultaneous Editing 上的信息页面.

但是,如果您仍然想避免该消息/提示,您可以重新定义执行提示的函数:

(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)

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

我建议不要覆盖这两个例程,但如果您愿意,它就在那里。

<小时/> 如果global-auto-revert-mode打开,您可以禁用它。将其添加到您的 .emacs:

(global-auto-revert-mode -1)

您可以通过查看同名变量来判断该模式是否已打开:

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

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

关于Emacs:如何禁用 'file changed on disk' 检查?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2284703/

相关文章:

涉及正斜杠的 Emacs 键绑定(bind)

emacs - 我可以在 Slime (Swank Emacs) 中后台运行线程吗

emacs - emacs shell 模式下的 Gnu screen : how to fix color escape codes

linux - 如何只允许在 Emacs 控制台上打印某些文本?

emacs - 错误类型参数 : stringp, nil 错误

bash - 在 Emacs shell 和 Cygwin 下处理信号

html - 在 org-mode 中,如何为 HTML 导出插入当前日期?

python - 对于 python,最接近 SLIME 的是什么?/从 EMACS 使用 python 的最佳方式是什么?

python - emacs 解释器中的命令历史记录

Emacs:键绑定(bind)到匿名函数的性能