Stop tramp-mode running on emacs' startup
Asked Answered
M

4

11

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: 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..)

I've cleared the recent-files history, but that made no difference..

Mia answered 19/5, 2009 at 1:46 Comment(3)
Other things to check: if you have desktop.el enabled, or perhaps custom.el settings? I'd start inserting (message "here") lines in your .emacs and checking the Messages buffer to track down where in your .emacs the tramp is starting.Devora
Do you byte-compile your .emacs? Perhaps you forgot to re-compile after removing tramp then?Speaks
Trey: the messages buffer tip helped, thanks!Mia
M
18

Aha, I found where tramp was being loaded:

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..

I just found this section of the emacs wiki explaining the problem,

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. Tramp means that this requires recentf to open up a remote site which will block your emacs process at the most inopportune times.

(require 'recentf)
(setq recentf-auto-cleanup 'never) ;; disable before we start recentf!
(recentf-mode 1)
Mia answered 19/5, 2009 at 14:8 Comment(1)
Also see: #2069197, where the recommended solution is (setq recentf-keep '(file-remote-p file-readable-p))Phenocryst
T
6

Another possibility is a listing in ~/.ido.last, if you are using ido-mode. In that case, the remedy is just "rm ~/.ido.last".

Thievery answered 6/3, 2010 at 23:36 Comment(0)
G
3

It sounds to me like you have a file that is opened via tramp and is being reopened at startup. Have to set emacs to restore your session?

Glimmer answered 19/5, 2009 at 13:17 Comment(1)
Nope, the only buffers that appear on startup are messages and scratch, and the tramp processes (one ssh and one scp)Mia
T
2

From the 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:

     (setq tramp-default-method "ftp")

Unloading tramp can be achieved by applying M-x tramp-unload-tramp. This resets also > the Ange-FTP plugins.

Note that I haven't tried this but hope it works for you!

Tamica answered 19/5, 2009 at 2:25 Comment(1)
Hm, nope, (setq tramp-default-method "ftp") doesn't seem to make any difference, neither does M-x tramp-unload-tramp (Well, it might unload it from memory, but not from startup)Mia

© 2022 - 2024 — McMap. All rights reserved.