aboutsummaryrefslogtreecommitdiffstats
path: root/src/callproc.c
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-07 21:53:28 +0000
committerRichard M. Stallman1994-05-07 21:53:28 +0000
commit093650fe31b91e7698032a1ccdecfb4d57b5ea6c (patch)
tree45797f3dd2a99dd9bf38afa231bde84c73aedaa5 /src/callproc.c
parentb8556aee0013f940a2439ed0738f9511f1deb077 (diff)
downloademacs-093650fe31b91e7698032a1ccdecfb4d57b5ea6c.tar.gz
emacs-093650fe31b91e7698032a1ccdecfb4d57b5ea6c.zip
[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.
Diffstat (limited to 'src/callproc.c')
-rw-r--r--src/callproc.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/callproc.c b/src/callproc.c
index d612a7f94c1..606d5e013e2 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -74,7 +74,12 @@ extern char **environ;
74#define max(a, b) ((a) > (b) ? (a) : (b)) 74#define max(a, b) ((a) > (b) ? (a) : (b))
75 75
76#ifdef MSDOS 76#ifdef MSDOS
77Lisp_Object Vbinary_process; 77/* When we are starting external processes we need to know whether they
78 take binary input (no conversion) or text input (\n is converted to
79 \r\n). Similar for output: if newlines are written as \r\n then it's
80 text process output, otherwise it's binary. */
81Lisp_Object Vbinary_process_input;
82Lisp_Object Vbinary_process_output;
78#endif 83#endif
79 84
80Lisp_Object Vexec_path, Vexec_directory, Vdata_directory, Vdoc_directory; 85Lisp_Object Vexec_path, Vexec_directory, Vdata_directory, Vdoc_directory;
@@ -84,6 +89,10 @@ Lisp_Object Vshell_file_name;
84 89
85Lisp_Object Vprocess_environment; 90Lisp_Object Vprocess_environment;
86 91
92#ifdef MSDOS
93Lisp_Object Qbuffer_file_type;
94#endif
95
87/* True iff we are about to fork off a synchronous process or if we 96/* True iff we are about to fork off a synchronous process or if we
88 are waiting for it. */ 97 are waiting for it. */
89int synch_process_alive; 98int synch_process_alive;
@@ -342,7 +351,7 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
342 pid = run_msdos_command (new_argv, current_dir, filefd, outfilefd); 351 pid = run_msdos_command (new_argv, current_dir, filefd, outfilefd);
343 close (outfilefd); 352 close (outfilefd);
344 fd1 = -1; /* No harm in closing that one! */ 353 fd1 = -1; /* No harm in closing that one! */
345 fd[0] = open (tempfile, NILP (Vbinary_process) ? O_TEXT : O_BINARY); 354 fd[0] = open (tempfile, NILP (Vbinary_process_output) ? O_TEXT : O_BINARY);
346 if (fd[0] < 0) 355 if (fd[0] < 0)
347 { 356 {
348 unlink (tempfile); 357 unlink (tempfile);
@@ -511,7 +520,14 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
511 filename_string = build_string (tempfile); 520 filename_string = build_string (tempfile);
512 start = args[0]; 521 start = args[0];
513 end = args[1]; 522 end = args[1];
523#ifdef MSDOS
524 specbind (Qbuffer_file_type, Vbinary_process_input);
525 Fwrite_region (start, end, filename_string, Qnil, Qlambda);
526 unbind_to (count, Qnil);
527#else
514 Fwrite_region (start, end, filename_string, Qnil, Qlambda); 528 Fwrite_region (start, end, filename_string, Qnil, Qlambda);
529#endif
530
515 record_unwind_protect (delete_temp_file, filename_string); 531 record_unwind_protect (delete_temp_file, filename_string);
516 532
517 if (!NILP (args[3])) 533 if (!NILP (args[3]))
@@ -817,6 +833,7 @@ init_callproc ()
817 register char * sh; 833 register char * sh;
818 Lisp_Object tempdir; 834 Lisp_Object tempdir;
819 835
836#ifndef MSDOS
820 if (initialized && !NILP (Vinstallation_directory)) 837 if (initialized && !NILP (Vinstallation_directory))
821 { 838 {
822 /* Add to the path the lib-src subdir of the installation dir. */ 839 /* Add to the path the lib-src subdir of the installation dir. */
@@ -838,6 +855,7 @@ init_callproc ()
838 } 855 }
839 } 856 }
840 } 857 }
858#endif
841 859
842 tempdir = Fdirectory_file_name (Vexec_directory); 860 tempdir = Fdirectory_file_name (Vexec_directory);
843 if (access (XSTRING (tempdir)->data, 0) < 0) 861 if (access (XSTRING (tempdir)->data, 0) < 0)
@@ -881,9 +899,16 @@ set_process_environment ()
881syms_of_callproc () 899syms_of_callproc ()
882{ 900{
883#ifdef MSDOS 901#ifdef MSDOS
884 DEFVAR_LISP ("binary-process", &Vbinary_process, 902 Qbuffer_file_type = intern ("buffer-file-type");
903 staticpro (&Qbuffer_file_type);
904
905 DEFVAR_LISP ("binary-process-input", &Vbinary_process_input,
906 "*If non-nil then new subprocesses are assumed to take binary input.");
907 Vbinary_process_input = Qnil;
908
909 DEFVAR_LISP ("binary-process-output", &Vbinary_process_output,
885 "*If non-nil then new subprocesses are assumed to produce binary output."); 910 "*If non-nil then new subprocesses are assumed to produce binary output.");
886 Vbinary_process = Qnil; 911 Vbinary_process_output = Qnil;
887#endif 912#endif
888 913
889 DEFVAR_LISP ("shell-file-name", &Vshell_file_name, 914 DEFVAR_LISP ("shell-file-name", &Vshell_file_name,