changeset 7397:e0ffa47f2ed4

[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.
author Richard M. Stallman <rms@gnu.org>
date Sat, 07 May 1994 21:53:28 +0000
parents 3774d6d8a5ee
children abb02a91f4cb
files src/callproc.c
diffstat 1 files changed, 29 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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,