Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Running GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601) with Win7, the shell command (M-x shell) always creates a dos box with the home directory. I've seen in other questions/answers that the default behaviour is to start a shell in the directory of the file in the current buffer e.g. Setting default working directory/drive in Emacs shell on Windows

I'm running from a limited user account but this has not affected any other functions so far. Googling produced lots of info on how to switch to alternative shells but I want to keep the normal dos box, I just want to be able to start in the directory of the file that I'm viewing.

So which options need to be reconfigured?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

This is most likely related to your configuration. Try starting emacs without it (emacs -q) and see is the behavior is still the same. I guess that somewhere in your config the `default-directory' var is set to either an invalid value or to your home directory. "M-: -> default-directory" will show you the current value.

share|improve this answer
    
Ok, that was weird. Your hints were enough to verify that it was definitely something to do with the start-up. The default-directory was set to my home directory but not when I started with -q. The config had no mention of directory settings so I just commented out everything except the custom-set-variables, started uncommenting things step-by-step to find the problem. After uncommenting everything, the default-dir is still ok and I can 'M-x shell' to the correct directory. Perhaps there was some problem with hidden characters. Regardless, the problem is solved. Thanks for your help! –  tiktok Dec 31 '12 at 9:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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