0

I am using Emacs-24.3 (and won't upgrade). Running the M-x shell command spuriously creates an unwanted C:\tmp directory. Yes, I am running on Windows (with Cygwin). I've turned off the .emacs start-up as well as killed my .bashrc to isolate this effect to the M-x shell command. I have no TMP or TEMP environment variables that specify C:\TMP, so I think it's default Unix behavior of using /tmp as the std system temp file dir.

In any case, I don't want this behavior on Windows (although I am willing to do whatever it takes to redirect useful behavior somewhere else, e.g. C:\WINDOWS\TEMP).

What do I have to do to suppress creation of this unwanted directory?

(Thanks in advance!)

koan911
  • 360
  • 1
  • 3
  • 13
  • If you set the variable `shell-file-name` to some other program, such as `/usr/bin/true`, does the directory still get created? I had a look at the source code for the `shell` command, and didn't find anything that would create the directory, so I just wanted to rule out the shell completely. – legoscia Jun 17 '15 at 15:02
  • 1
    @legoscia Thanks for that helpful suggestion. So it is not a Emacs nor M-x shell problem: this is bash behavior to create C:\TMP. I have defined TMPDIR to make it use the windows location but it still goes ahead and creates C:\TMP. :( I'll solve this as a bash problem or open another question in SO with bash as topic. Thx. – koan911 Jun 18 '15 at 04:14

1 Answers1

1

Few suggestions:

Control your temporary-file-directory environment setting

or look at the TEMP part of: http://www.gnu.org/software/emacs/manual/html_node/emacs/General-Variables.html

TEMP These environment variables are used to initialize the variable temporary-file-directory, which specifies a directory in which to put temporary files (see Backup). Emacs tries to use TMPDIR first. If that is unset, Emacs normally falls back on /tmp, but on MS-Windows and MS-DOS it instead falls back on TMP, then TEMP, and finally c:/temp.

Or look at: How do I control how Emacs makes backup files?

Community
  • 1
  • 1
Pieter21
  • 1,765
  • 1
  • 10
  • 22