Search code examples
emacstramp

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


Solution

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