如何强制 Emacs 临时超时?
我在 emacs 中经常使用 TRAMP。然而,有时服务器会宕机,流浪汉会等待超时。通常是在 ido 模式下执行 Cxf
之后打开一个新文件。我必须等待一段令人烦恼的漫长时间。有没有一种简单的方法可以告诉 TRAMP 超时并让 ido 模式继续。我尝试了 Cg,但打开文件的选项从未出现过。
I use TRAMP a lot with emacs. However, sometimes a server goes down and tramp sits waiting for a timeout. Usually it's after doing a C-x-f
in ido-mode to open a new file. I have to wait an annoyingly long amount of time. Is there an easy way to tell TRAMP to timeout and let ido-mode continue. I try C-g
and the option to open a file never happens.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在那些(频繁)的情况下,当tramp停止时,我只需使用
Cg
停止进程,杀死tramp缓冲区,然后我就可以保存文件。In thoses (frequent) cases when tramp stalls, I just halt the process with
C-g
, kill the tramp buffer and I can then save the file.我发现了一个提示,可以将痛苦的等待时间限制在 5 秒之内。将此行添加到 .ssh/config:
但是,五秒钟后,您仍然无法选择文件。因此,当它失败时,只需对已关闭的服务器上未打开的缓冲区执行
Cx b
即可,并且从那里开始Cxf
不会永远花费时间。I found one hint that can limit the painful wait to 5 seconds. Add this line to .ssh/config:
However, after five seconds, you still can't choose a file. So, when it fails just do a
C-x b
to a buffer that's not opened on the downed server andC-x-f
from there will not take forever.尽管我经常使用 TRAMP,但我没有遇到这种超时情况。尝试像
我使用的 this 和 this 提出此建议。比
keyboard-quit
更好的东西可能适合你。I don't face such timeout situation though I frequently use TRAMP. Try something like
I used this and this to make this suggestion. something better than
keyboard-quit
could work for you.