I am working on a local file and I will see these TRAMP messages:

Tramp: Opening connection for YYY@XXX.XXX.com using ssh...
Tramp: Sending command `exec ssh -l YYY  -o ControlPath=/var/folders/4c/5l5ydzjx1jqbjc3t60t41vpc0000gn/T/tramp.40799Yr1.%r@%h:%p -o ControlMaster=auto -o ControlPersist=no -e none XXX.XXX.com'
Tramp: Waiting for prompts from remote shell...
Tramp: Sending password
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on `XXX.XXX.com'
Tramp: Opening connection for YYY@XXX.XXX.com using ssh...done
Making tags-file-name local to TAGS while let-bound!

Why is emacs automatically establishing a remote connection? Why is it automatically building a TAGS file? How can disable these two features? Where are the references to the TAGS files stored, so one can edit it?

At one point this froze emacs to the point C-g repeatedly did not help.


My machine was disconnected from the network and was able to catch this new error which likely seems related, as I was not working on a remote file.

Company: An error occurred in auto-begin
Company: Back-end (company-dabbrev-code company-gtags company-etags company-keywords) error "Tramp failed to connect.  If this happens repeatedly, try
    `M-x tramp-cleanup-this-connection'" with args (candidates CpF)
Company: An error occurred in auto-begin
Company: Back-end (company-dabbrev-code company-gtags company-etags company-keywords) error "File /ssh:***@***.com/project/TAGS does not exist" with args (candidates CpFq)

Still don't know how to resolve the issue, but hopefully this will provide a clue.

  • A wild guess: you have a directory local file which suggests doing something like that. Also the warning about let-bound seems to come from CEDET - are you by any chance using EDE project? Maybe this project has something in its settings that requires Tramp to fetch it from another machine?
    – wvxvw
    Sep 5, 2015 at 9:01

1 Answer 1


Please be more clear about exactly what you are doing wrt "working on a local file", so people can better help you.

(From those messages, I don't think Emacs is building a TAGS file here, but it is using a TAGS file.)

  • If you use recentf-mode then check your recent files. If one of them is remote then that's probably your problem. Remove it and make recentf behave.

    You can prevent the saving of remote file names by recentf by customizing recentf-exclude, so that it includes a remote host, for example. You can also customize recentf-keep.

  • Some uses of file-name completion might include remote files or directories among the candidates to match, in which case Tramp can be accessed automatically.

  • Similarly, if you are somehow using a TAGS file, and if that file includes stuff from remote files, then that could explain what you are seeing. Check any TAGS files you think you might be using.

  • Possibly some other code you are using is testing for a file's remoteness by actually accessing it, instead of using, say, file-remote-p.

Again, give us more information and people might be able to help you more. A step-by-step recipe to repro the problem, especially one that starts from emacs -Q (no init file), is the best way to tell us what you are doing.

  • I noticed today, that when I hit TAB - AC first connects to the remote before loading the list of auto completions. The file is a local file however. Sep 3, 2015 at 20:19
  • 1. You are introducing new things (AC - presumably library autocomplete.el?) without specifying them in your question. Without a clear question you will likely not get all the help you need. 2. Try to figure out where "AC" is getting the remote file or even the remote host from. Perhaps it has a cache somewhere? You will need to look around a bit, and perhaps consult the doc of "AC".
    – Drew
    Sep 3, 2015 at 21:45
  • It's not clear what it is triggering TRAMP mode, I'm guessing based on an action I took. I also looked for recentf-exclude, it does not seem to be an emacs command, how would it be modified? Sep 4, 2015 at 15:01
  • recentf-exclude is a user option. But if you don't have it (try C-h v) then you are not using library recentf.el, so there is no need to worry about it.
    – Drew
    Sep 8, 2015 at 17:45
  • do not have recentf-exclude Sep 8, 2015 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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