# HG changeset patch # User Richard M. Stallman # Date 768347608 0 # Node ID e0ffa47f2ed4e676b8147a45463ae05c8e69f6ad # Parent 3774d6d8a5ee9fd9e5ae7df1c1fb19185075cfa1 [MSDOS]: Rename Vbinary_process to Vbinary_process_output. (syms_of_callproc) [MSDOS]: Rename lisp variable binary-process to binary-process-output. (Fcall_process, syms_of_callproc) [MSDOS]: Use new names. (Vbinary_process_input) [MSDOS]: New variable. (syms_of_callproc) [MSDOS]: Declare binary-process-input. (Fcall_process_region) [MSDOS]: Bind binary-process-input temporarily to buffer-file-type. (init_callproc) [MSDOS]: Don't add lib-src as the wrapped binaries are in bin. diff -r 3774d6d8a5ee -r e0ffa47f2ed4 src/callproc.c --- a/src/callproc.c Sat May 07 19:47:44 1994 +0000 +++ b/src/callproc.c Sat May 07 21:53:28 1994 +0000 @@ -74,7 +74,12 @@ #define max(a, b) ((a) > (b) ? (a) : (b)) #ifdef MSDOS -Lisp_Object Vbinary_process; +/* When we are starting external processes we need to know whether they + take binary input (no conversion) or text input (\n is converted to + \r\n). Similar for output: if newlines are written as \r\n then it's + text process output, otherwise it's binary. */ +Lisp_Object Vbinary_process_input; +Lisp_Object Vbinary_process_output; #endif Lisp_Object Vexec_path, Vexec_directory, Vdata_directory, Vdoc_directory; @@ -84,6 +89,10 @@ Lisp_Object Vprocess_environment; +#ifdef MSDOS +Lisp_Object Qbuffer_file_type; +#endif + /* True iff we are about to fork off a synchronous process or if we are waiting for it. */ int synch_process_alive; @@ -342,7 +351,7 @@ pid = run_msdos_command (new_argv, current_dir, filefd, outfilefd); close (outfilefd); fd1 = -1; /* No harm in closing that one! */ - fd[0] = open (tempfile, NILP (Vbinary_process) ? O_TEXT : O_BINARY); + fd[0] = open (tempfile, NILP (Vbinary_process_output) ? O_TEXT : O_BINARY); if (fd[0] < 0) { unlink (tempfile); @@ -511,7 +520,14 @@ filename_string = build_string (tempfile); start = args[0]; end = args[1]; +#ifdef MSDOS + specbind (Qbuffer_file_type, Vbinary_process_input); Fwrite_region (start, end, filename_string, Qnil, Qlambda); + unbind_to (count, Qnil); +#else + Fwrite_region (start, end, filename_string, Qnil, Qlambda); +#endif + record_unwind_protect (delete_temp_file, filename_string); if (!NILP (args[3])) @@ -817,6 +833,7 @@ register char * sh; Lisp_Object tempdir; +#ifndef MSDOS if (initialized && !NILP (Vinstallation_directory)) { /* Add to the path the lib-src subdir of the installation dir. */ @@ -838,6 +855,7 @@ } } } +#endif tempdir = Fdirectory_file_name (Vexec_directory); if (access (XSTRING (tempdir)->data, 0) < 0) @@ -881,9 +899,16 @@ syms_of_callproc () { #ifdef MSDOS - DEFVAR_LISP ("binary-process", &Vbinary_process, + Qbuffer_file_type = intern ("buffer-file-type"); + staticpro (&Qbuffer_file_type); + + DEFVAR_LISP ("binary-process-input", &Vbinary_process_input, + "*If non-nil then new subprocesses are assumed to take binary input."); + Vbinary_process_input = Qnil; + + DEFVAR_LISP ("binary-process-output", &Vbinary_process_output, "*If non-nil then new subprocesses are assumed to produce binary output."); - Vbinary_process = Qnil; + Vbinary_process_output = Qnil; #endif DEFVAR_LISP ("shell-file-name", &Vshell_file_name,