Lisp_Object Vexec_path, Vexec_directory, Vdata_directory, Vdoc_directory;
Lisp_Object Vconfigure_info_directory;
+Lisp_Object Vtemp_file_name_pattern;
Lisp_Object Vshell_file_name;
register Lisp_Object start, end;
#ifdef DOS_NT
char *tempfile;
-#else
- char tempfile[20];
-#endif
- int count = specpdl_ptr - specpdl;
-#ifdef DOS_NT
char *outf = '\0';
if ((outf = egetenv ("TMP")) || (outf = egetenv ("TEMP")))
strcat (tempfile, "detmp.XXX");
#endif
#else /* not DOS_NT */
-
-#ifdef VMS
- strcpy (tempfile, "tmp:emacsXXXXXX.");
-#else
- strcpy (tempfile, "/tmp/emacsXXXXXX");
-#endif
+ char *tempfile = (char *) alloca (XSTRING (Vtemp_file_name_pattern)->size + 1);
+ bcopy (XSTRING (Vtemp_file_name_pattern)->data, tempfile,
+ XSTRING (Vtemp_file_name_pattern)->size + 1);
#endif /* not DOS_NT */
mktemp (tempfile);
sh = (char *) getenv ("SHELL");
Vshell_file_name = build_string (sh ? sh : "/bin/sh");
#endif
+
+#ifdef VMS
+ Vtemp_file_name_pattern = build_string ("tmp:emacsXXXXXX.");
+#else
+ if (getenv ("TMPDIR"))
+ {
+ char *dir = getenv ("TMPDIR");
+ Vtemp_file_name_pattern
+ = Fexpand_file_name (build_string ("emacsXXXXXX"),
+ build_string (dir));
+ }
+ else
+ Vtemp_file_name_pattern = build_string ("/tmp/emacsXXXXXX");
+#endif
}
set_process_environment ()
includes this.");
Vconfigure_info_directory = build_string (PATH_INFO);
+ DEFVAR_LISP ("temp-file-name-pattern", &Vtemp_file_name_pattern,
+ "Pattern for making names for temporary files.\n\
+This is used by `call-process-region'.");
+ /* The real initialization is when we start again. */
+ Vtemp_file_name_pattern = Qnil;
+
DEFVAR_LISP ("process-environment", &Vprocess_environment,
"List of environment variables for subprocesses to inherit.\n\
Each element should be a string of the form ENVVARNAME=VALUE.\n\