summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-06-10 20:59:16 +0000
committerRichard M. Stallman <rms@gnu.org>1998-06-10 20:59:16 +0000
commit106d63c9d31933451565eb7840ca99f5ce8d3a3b (patch)
treea9c1b21879f3cd7272444f2f37c365430dedc066
parent82678272dfb07e5c775474a9db5317baf5306414 (diff)
downloademacs-106d63c9d31933451565eb7840ca99f5ce8d3a3b.tar.gz
(command-line): Set `temporary-file-directory' based
on environment settings, before processing init files.
-rw-r--r--lisp/startup.el10
1 files changed, 10 insertions, 0 deletions
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