尝试通过 sshfs 保存文件时 emacs 发出警告
我安装了一个 sshfs 文件系统,
% sshfs remote.host.org:/home/jrm /home/mnt/remote.host
然后在该文件系统下编辑一个文件,
% emacsclient -n /home/mnt/remote.host/some_file.c.
当我保存文件时,我收到警告
some_file.c has changed since visited or saved. Save anyway? (yes or no)
其他编辑器没有这个问题。是什么原因造成的?我该如何预防?两台主机都运行 ntp 并且时间相同。
TIA。
PS我知道我可以直接用tramp打开文件,但我更喜欢sshfs,假设我每次尝试保存文件时都可以摆脱这个警告。
I mount an sshfs file system with
% sshfs remote.host.org:/home/jrm /home/mnt/remote.host
then edit a file under this file system with
% emacsclient -n /home/mnt/remote.host/some_file.c.
When I save the file I get the warning
some_file.c has changed since visited or saved. Save anyway? (yes or no)
Other editors don't have this problem. What is causing this? How can I prevent it? Both hosts are running ntp and the times are the same.
TIA.
P.S. I'm aware that I can open the files directly with tramp, but I prefer sshfs assuming I can get rid of this warning every time I try to save a file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了这个问题,一种解决方案是,如果您确定不会覆盖重要的内容,则忽略文件已更改的警告。
我编写了一个名为 modtime-skip-mode 的小次要模式来忽略所有文件更改警告,
您可以在此处找到该存储库:
https://github.com/jordonbiondo/modtime-skip-mode
这个包也是在 Marmalade 上,所以如果您有这样的设置,您只需
Mx: package-install; modtime-skip-mode <输入>
I had this problem and one solution is to just ignore the warnings that the file has changed if you're sure you won't be writing over something important.
I wrote a small minor mode to ignore all file change warnings called modtime-skip-mode
you can find the repo here:
https://github.com/jordonbiondo/modtime-skip-mode
this package is also on Marmalade so if you have that setup you can just
M-x: package-install <enter> modtime-skip-mode <enter>