From: Richard M. Stallman Date: Wed, 10 Jun 1998 20:59:16 +0000 (+0000) Subject: (command-line): Set `temporary-file-directory' based X-Git-Tag: emacs-20.3~650 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=849eedba17e4ac5f287017a7a3a42db950c854b3;p=emacs.git (command-line): Set `temporary-file-directory' based on environment settings, before processing init files. --- diff --git a/lisp/startup.el b/lisp/startup.el index 55a05fb6083..07c6c241f32 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -468,6 +468,16 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (defun command-line () (setq command-line-default-directory default-directory) + ;; Choose a reasonable location for temporary files. + (setq temporary-file-directory + (file-name-as-directory + (cond ((memq system-type '(ms-dos windows-nt)) + (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP") "c:/temp")) + ((memq system-type '(vax-vms axp-vms)) + (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "SYS$SCRATCH:")) + (t + (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp"))))) + ;; See if we should import version-control from the environment variable. (let ((vc (getenv "VERSION_CONTROL"))) (cond ((eq vc nil)) ;don't do anything if not set