In Emacs, how do I figure out which package is loading tramp?

前端 未结 4 1945
我寻月下人不归
我寻月下人不归 2021-02-09 12:11

I have a strange interaction with tramp and cygwin-mount (I think: Emacs: Tab completion of file name appends an extra i:\\cygwin). Because of this, I want to disable tramp. I\'

相关标签:
4条回答
  • 2021-02-09 12:29

    I think you'll find that tramp is turned on by default. If you do:

    M-x customize-apropos
    Customize (regexp): tramp
    

    ('Customize (regexp):' is the prompt from emacs) you'll see two variables listed (at least I do in emacs 23), something like:

    alt text

    If you set tramp-mode to 'off', save for future sessions, and restart emacs tramp should no longer be loaded. I believe you can just turning it off in the current session should allow you to test this, but this doesn't always work with customize variables, although it should do with something like tramp that is part of the standard emacs distribution.

    I don't have emacs 22 installed any more, but something similar should work for that too.

    0 讨论(0)
  • 2021-02-09 12:32

    What a great question! If only because I was not aware of the function (eval-after-load file form) which will enable you to write code like the following and put it in your .emacs file:

    (eval-after-load "tramp"
      '(debug))
    

    Which will, in brute force form, vomit a backtrace in your window and reveal the offending library.

    0 讨论(0)
  • 2021-02-09 12:46

    I had a similar problem with tramp, when one day I found "/C:\...\debuglog.txt" on my system. Because of that file, auto-complete was invoking tramp each time I entered "/". And tramp was of course giving an error. auto-complete was calling

    (expand-file-name ...)
    

    which, because of the current file-name-handler-alist, was calling tramp. My solution was:

    (delete-if
     (lambda (x)
       (or (eq (cdr x) 'tramp-completion-file-name-handler)
           (eq (cdr x) 'tramp-file-name-handler)))
     file-name-handler-alist)
    
    0 讨论(0)
  • 2021-02-09 12:46

    Instrument find-file for debugging and/or instrument your init file for debugging. Then you can step through the loading and see where the tramp stuff is loaded.

    0 讨论(0)
提交回复
热议问题