When I create a new file in a (currently) non-existent directory, the echo area displays:

Use M-x make-directory RET RET to create the directory and its parents

which I plan on doing as soon as skeletons, etc. are inserted. However, before I have a chance to do so, Tramp decides to make an uninvited entrance:

Password for /sudo:root@localhost: 

and the only way to stop it from asking is to use C-g.

Is there any way to tell Tramp to stop doing this? I don't want to disable Tramp entirely (though I think I did do this at one point until I needed Tramp for something).

My .emacs.d can be found here.

1 Answer 1


Tramp must check whether the directory, you intend to create the new file in, does exist. This can be done only by checking on the remote host. Asking for the password is part of the connection to the remote host.

  • Except that there is no remote host as it's local. Is it possible to have tramp skip checking sub-directories of $HOME?
    – ivanm
    May 18, 2016 at 6:10
  • 1
    If Tramp asks for a password there is a reason. Could you pls show a scenario how it happens, starting with emacs -Q? May 18, 2016 at 10:57
  • I've worked it out: I had the defadvice from this blog post which was causing the problems; an altered version in the comments seems to fix it though: emacsredux.com/blog/2013/04/21/edit-files-as-root
    – ivanm
    May 19, 2016 at 0:55

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.