Mercurial > emacs
changeset 16627:530b3f7373db
(Vtemp_file_name_pattern): New variable.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 07 Dec 1996 21:10:03 +0000 |
parents | abde29194979 |
children | 25e8123eb6c5 |
files | src/callproc.c |
diffstat | 1 files changed, 24 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/callproc.c Sat Dec 07 20:51:34 1996 +0000 +++ b/src/callproc.c Sat Dec 07 21:10:03 1996 +0000 @@ -95,6 +95,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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\