aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/callproc.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 8141a18a909..c304858eea7 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -71,6 +71,7 @@ extern char *strerror ();
71#include "commands.h" 71#include "commands.h"
72#include "buffer.h" 72#include "buffer.h"
73#include "charset.h" 73#include "charset.h"
74#include "ccl.h"
74#include "coding.h" 75#include "coding.h"
75#include <paths.h> 76#include <paths.h>
76#include "process.h" 77#include "process.h"
@@ -176,6 +177,7 @@ call_process_cleanup (fdpid)
176 177
177DEFUN ("call-process", Fcall_process, Scall_process, 1, MANY, 0, 178DEFUN ("call-process", Fcall_process, Scall_process, 1, MANY, 0,
178 "Call PROGRAM synchronously in separate process.\n\ 179 "Call PROGRAM synchronously in separate process.\n\
180The remaining arguments are optional.\n\
179The program's input comes from file INFILE (nil means `/dev/null').\n\ 181The program's input comes from file INFILE (nil means `/dev/null').\n\
180Insert output in BUFFER before point; t means current buffer;\n\ 182Insert output in BUFFER before point; t means current buffer;\n\
181 nil for BUFFER means discard it; 0 means discard and don't wait.\n\ 183 nil for BUFFER means discard it; 0 means discard and don't wait.\n\
@@ -424,12 +426,16 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
424 426
425 /* The Irix 4.0 compiler barfs if we eliminate dummy. */ 427 /* The Irix 4.0 compiler barfs if we eliminate dummy. */
426 new_argv[i - 3] = dummy1; 428 new_argv[i - 3] = dummy1;
429 argument_coding.mode |= CODING_MODE_LAST_BLOCK;
427 encode_coding (&argument_coding, 430 encode_coding (&argument_coding,
428 XSTRING (args[i])->data, 431 XSTRING (args[i])->data,
429 new_argv[i - 3], 432 new_argv[i - 3],
430 STRING_BYTES (XSTRING (args[i])), 433 STRING_BYTES (XSTRING (args[i])),
431 size); 434 size);
432 new_argv[i - 3][argument_coding.produced] = 0; 435 new_argv[i - 3][argument_coding.produced] = 0;
436 /* We have to initialize CCL program status again. */
437 if (argument_coding.type == coding_type_ccl)
438 setup_ccl_program (&(argument_coding.spec.ccl.encoder), Qnil);
433 } 439 }
434 UNGCPRO; 440 UNGCPRO;
435 } 441 }
@@ -778,6 +784,7 @@ delete_temp_file (name)
778DEFUN ("call-process-region", Fcall_process_region, Scall_process_region, 784DEFUN ("call-process-region", Fcall_process_region, Scall_process_region,
779 3, MANY, 0, 785 3, MANY, 0,
780 "Send text from START to END to a synchronous process running PROGRAM.\n\ 786 "Send text from START to END to a synchronous process running PROGRAM.\n\
787The remaining arguments are optional.\n\
781Delete the text if fourth arg DELETE is non-nil.\n\ 788Delete the text if fourth arg DELETE is non-nil.\n\
782\n\ 789\n\
783Insert output in BUFFER before point; t means current buffer;\n\ 790Insert output in BUFFER before point; t means current buffer;\n\
@@ -876,12 +883,22 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
876 883
877 record_unwind_protect (delete_temp_file, filename_string); 884 record_unwind_protect (delete_temp_file, filename_string);
878 885
879 if (!NILP (args[3])) 886 if (nargs > 3 && !NILP (args[3]))
880 Fdelete_region (start, end); 887 Fdelete_region (start, end);
881 888
882 args[3] = filename_string; 889 if (nargs > 3)
890 {
891 args += 2;
892 nargs -= 2;
893 }
894 else
895 {
896 args[0] = args[2];
897 nargs = 2;
898 }
899 args[1] = filename_string;
883 900
884 RETURN_UNGCPRO (unbind_to (count, Fcall_process (nargs - 2, args + 2))); 901 RETURN_UNGCPRO (unbind_to (count, Fcall_process (nargs, args)));
885} 902}
886 903
887#ifndef VMS /* VMS version is in vmsproc.c. */ 904#ifndef VMS /* VMS version is in vmsproc.c. */