aboutsummaryrefslogtreecommitdiffstats
path: root/src/callproc.c
diff options
context:
space:
mode:
authorKenichi Handa2010-09-30 13:28:34 +0900
committerKenichi Handa2010-09-30 13:28:34 +0900
commitfcaf88782ba68e7c0618a663db51cf4a26cb3926 (patch)
tree589ae64ef6f2e2acc260726235d0c98b29150c0a /src/callproc.c
parent9fb7a510c91c6aad04d2d6ba8e8c0889d19e1d79 (diff)
downloademacs-fcaf88782ba68e7c0618a663db51cf4a26cb3926.tar.gz
emacs-fcaf88782ba68e7c0618a663db51cf4a26cb3926.zip
Complement a coding system for encoding arguments and input to a process.
Diffstat (limited to 'src/callproc.c')
-rw-r--r--src/callproc.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/callproc.c b/src/callproc.c
index bed3302e508..863d4e41dbd 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -287,21 +287,16 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
287 if (!NILP (Vcoding_system_for_write)) 287 if (!NILP (Vcoding_system_for_write))
288 val = Vcoding_system_for_write; 288 val = Vcoding_system_for_write;
289 else if (! must_encode) 289 else if (! must_encode)
290 val = Qnil; 290 val = Qraw_text;
291 else 291 else
292 { 292 {
293 args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); 293 args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2);
294 args2[0] = Qcall_process; 294 args2[0] = Qcall_process;
295 for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; 295 for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
296 coding_systems = Ffind_operation_coding_system (nargs + 1, args2); 296 coding_systems = Ffind_operation_coding_system (nargs + 1, args2);
297 if (CONSP (coding_systems)) 297 val = CONSP (coding_systems) ? XCDR (coding_systems) : Qnil;
298 val = XCDR (coding_systems);
299 else if (CONSP (Vdefault_process_coding_system))
300 val = XCDR (Vdefault_process_coding_system);
301 else
302 val = Qnil;
303 } 298 }
304 val = coding_inherit_eol_type (val, Qnil); 299 val = complement_process_encoding_system (val);
305 setup_coding_system (Fcheck_coding_system (val), &argument_coding); 300 setup_coding_system (Fcheck_coding_system (val), &argument_coding);
306 coding_attrs = CODING_ID_ATTRS (argument_coding.id); 301 coding_attrs = CODING_ID_ATTRS (argument_coding.id);
307 if (NILP (CODING_ATTR_ASCII_COMPAT (coding_attrs))) 302 if (NILP (CODING_ATTR_ASCII_COMPAT (coding_attrs)))
@@ -954,20 +949,16 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
954 if (!NILP (Vcoding_system_for_write)) 949 if (!NILP (Vcoding_system_for_write))
955 val = Vcoding_system_for_write; 950 val = Vcoding_system_for_write;
956 else if (NILP (current_buffer->enable_multibyte_characters)) 951 else if (NILP (current_buffer->enable_multibyte_characters))
957 val = Qnil; 952 val = Qraw_text;
958 else 953 else
959 { 954 {
960 args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); 955 args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2);
961 args2[0] = Qcall_process_region; 956 args2[0] = Qcall_process_region;
962 for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; 957 for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
963 coding_systems = Ffind_operation_coding_system (nargs + 1, args2); 958 coding_systems = Ffind_operation_coding_system (nargs + 1, args2);
964 if (CONSP (coding_systems)) 959 val = CONSP (coding_systems) ? XCDR (coding_systems) : Qnil;
965 val = XCDR (coding_systems);
966 else if (CONSP (Vdefault_process_coding_system))
967 val = XCDR (Vdefault_process_coding_system);
968 else
969 val = Qnil;
970 } 960 }
961 val = complement_process_encoding_system (val);
971 962
972 { 963 {
973 int count1 = SPECPDL_INDEX (); 964 int count1 = SPECPDL_INDEX ();