summaryrefslogtreecommitdiff
path: root/lisp/startup.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/startup.el')
-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