From 849eedba17e4ac5f287017a7a3a42db950c854b3 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 10 Jun 1998 20:59:16 +0000 Subject: [PATCH] (command-line): Set `temporary-file-directory' based on environment settings, before processing init files. --- lisp/startup.el | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- 2.39.2