changeset 22429:38486c386abb

(command-line): Set `temporary-file-directory' based on environment settings, before processing init files.
author Richard M. Stallman <rms@gnu.org>
date Wed, 10 Jun 1998 20:59:16 +0000
parents 191fa10a366c
children 921311b43bf4
files lisp/startup.el
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/startup.el	Wed Jun 10 20:57:59 1998 +0000
+++ b/lisp/startup.el	Wed Jun 10 20:59:16 1998 +0000
@@ -468,6 +468,16 @@
 (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