summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-12-07 21:10:03 +0000
committerRichard M. Stallman <rms@gnu.org>1996-12-07 21:10:03 +0000
commit09e1bc0fa8fd226ddcabebe9631b0d9d1b1bf503 (patch)
tree939497631ded19fb667cca4962544120cd27f33b
parent05b4753969c81befa925474442033212ffa05132 (diff)
downloademacs-09e1bc0fa8fd226ddcabebe9631b0d9d1b1bf503.tar.gz
(Vtemp_file_name_pattern): New variable.
-rw-r--r--src/callproc.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/callproc.c b/src/callproc.c
index a5ca75f726e..c76c1fd2bcb 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -95,6 +95,7 @@ Lisp_Object Vbinary_process_output;
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;
@@ -634,11 +635,6 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
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")))
@@ -660,12 +656,9 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
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);
@@ -1097,6 +1090,20 @@ init_callproc ()
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 ()
@@ -1154,6 +1161,12 @@ Emacs's info files; the default value for Info-default-directory-list\n\
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\