简体   繁体   English

在emacs的启动时停止运行tramp-mode

[英]Stop tramp-mode running on emacs' startup

I was trying out tramp-mode , but now I cannot seem to get rid of it.. Whenever I start emacs, it spends about 20 seconds going through various tramp-related initialisations.. 我正在尝试使用tramp-mode ,但现在我似乎无法摆脱它。每当我启动emacs时,它会花费大约20秒来完成各种与tramp相关的初始化。

tramp: Waiting 60s for prompt from remote shell
tramp: Setting up remote shell environment

..and so on. ..等等。

How on earth do I unload tramp? 我怎么卸载流浪汉? grep'ing my ~/.emacs.d found nothing aside from the plugin itself (which doesn't seem to be loaded anywhere..) grep'ing my ~/.emacs.d除了插件本身之外什么~/.emacs.d发现(似乎没有加载到任何地方..)

I've cleared the recent-files history, but that made no difference.. 我已经清除了最近的文件历史记录,但这没有任何区别......

Aha, I found where tramp was being loaded: 啊哈,我发现了加载tramp的地方:

Loading /Users/dbr/.recentf...done
Loading tramp-mode..

I had a two files in my ~/.recentf file-history which were opened with tramp, removing them stops tramp from loading.. 我的~/.recentf文件历史记录中有两个文件, ~/.recentf文件是用tramp打开的,删除它们会阻止tramp加载..

I just found this section of the emacs wiki explaining the problem, 我刚刚发现emacs wiki的这一部分解释了这个问题,

When using TrampMode with recentf.el, it's advisable to turn off the cleanup feature of recentf that attempts to stat all the files and remove them from the recently accessed list if they are readable. 当使用带有recentf.el的TrampMode时,建议关闭recentf的清理功能,尝试统计所有文件并将其从最近访问的列表中删除(如果它们是可读的)。 Tramp means that this requires recentf to open up a remote site which will block your emacs process at the most inopportune times. Tramp意味着这需要recentf打开一个远程站点,该站点将在最不合适的时间阻止您的emacs进程。

 (require 'recentf) (setq recentf-auto-cleanup 'never) ;; disable before we start recentf! (recentf-mode 1) 

Another possibility is a listing in ~/.ido.last, if you are using ido-mode. 另一种可能性是〜/ .ido.last中的列表,如果您使用的是ido-mode。 In that case, the remedy is just "rm ~/.ido.last". 在这种情况下,补救措施只是“rm~ / .ido.last”。

It sounds to me like you have a file that is opened via tramp and is being reopened at startup. 听起来像你有一个通过tramp打开的文件,并在启动时重新打开。 Have to set emacs to restore your session? 必须设置emacs才能恢复会话?

From the tramp faq : 来自tramp faq

How can I disable tramp? 我怎样才能禁用流浪汉?

Shame on you, why did you read until now? 对你感到羞耻,你为什么要读到现在?

If you just want to have Ange-FTP as default remote files access package, you should > apply the following code: 如果您只想将Ange-FTP作为默认远程文件访问包,则应>应用以下代码:

  (setq tramp-default-method "ftp") 

Unloading tramp can be achieved by applying Mx tramp-unload-tramp. 卸载tramp可以通过应用Mx tramp-unload-tramp来实现。 This resets also > the Ange-FTP plugins. 这也重置了Ange-FTP插件。

Note that I haven't tried this but hope it works for you! 请注意,我没有尝试过,但希望它适合你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM