I have an issue where if I try to perform some random Emacs operations such as org-capture, or renaming a file to a different (local) directory in dired, Emacs attempts to contact a different machine using tramp, presumably for some sort of auto-completion or history reasoning. This causes a lot of hanging and waiting, because the machine tramp is trying to connect to is not available.

How can I prevent Emacs from looking up tramp files/locations when I perform other rudimentary operations? How can I determine where and how Emacs is getting the idea that it needs to look inside a remote file/location for operations like org-capture and dired-do-rename?

  • Assuming that there is a short delay before Emacs starts to contact a remote machine when you try to rename a file in Dired, try pressing C-f right after you hit R. Does that help?
    – itsjeyd
    Commented Oct 7, 2014 at 9:23
  • The behaviour you're describing is not one I've ever experienced. Could you provide a minimal example?
    – Malabarba
    Commented Oct 10, 2014 at 12:38
  • I have experienced this behaviour before but with using helm as the completing read. I don't experience this with ido for example.
    – Gambo
    Commented Oct 29, 2014 at 10:22
  • 1
    If you have recentf <emacswiki.org/RecentFiles> enabled it may try to connect to remote machines. I've got the following in my init.el file. (setq recentf-exclude '("~$" "/tmp/" "/ssh:" "/sudo:")) I set this up several years ago. Having remote files in the recent file list was causing me some problems but I don't remember the details. You may have to remove all remote files from the recent file list manually. Its location is defined by the variable recentf-save-file.
    – Colin Bell
    Commented Nov 11, 2014 at 5:34
  • 1
    Try enabling debug-on-quit by doing M-xtoggle-debug-on-quitRET and then press C-g when emacs hangs. It would print a stacktrace, it might help debugging the problem Commented Dec 27, 2014 at 13:03

1 Answer 1


I suspect that some code kicks in, due to a hook or advise, which should be using remote-file-p instead of tramp-tramp-file-p. Read the documentation of both and then grep the installed packages for the latter symbol, replacing it were appropriate. If that fixes the issue, start opening pull requests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.