diff options
| author | Kenichi Handa | 1998-06-26 03:29:15 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-06-26 03:29:15 +0000 |
| commit | d5d4ae71937bd69f7f59aac44395d48bb90c5fce (patch) | |
| tree | cb5d5004419e22666e6aed2755a25648563fefc8 /src/process.c | |
| parent | 57515cfea135bd63cc4a9820567f74397544bcc4 (diff) | |
| download | emacs-d5d4ae71937bd69f7f59aac44395d48bb90c5fce.tar.gz emacs-d5d4ae71937bd69f7f59aac44395d48bb90c5fce.zip | |
(Fstart_process): Check process-coding-system-alist
and default-process-coding-system even in unibyte mode.
(create_process): In unibyte mode, suppress character code
conversion.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/process.c b/src/process.c index d76cebe5e12..73cf694e0be 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1207,24 +1207,17 @@ Remaining arguments are strings to give program as arguments.") | |||
| 1207 | BUF_ZV_BYTE (XBUFFER (buffer))); | 1207 | BUF_ZV_BYTE (XBUFFER (buffer))); |
| 1208 | 1208 | ||
| 1209 | { | 1209 | { |
| 1210 | /* Setup coding systems for communicating with the process. */ | 1210 | /* Decide coding systems for communicating with the process. Here |
| 1211 | we don't setup the structure coding_system nor pay attention to | ||
| 1212 | unibyte mode. They are done in create_process. */ | ||
| 1213 | |||
| 1211 | /* Qt denotes we have not yet called Ffind_operation_coding_system. */ | 1214 | /* Qt denotes we have not yet called Ffind_operation_coding_system. */ |
| 1212 | Lisp_Object coding_systems = Qt; | 1215 | Lisp_Object coding_systems = Qt; |
| 1213 | Lisp_Object val, *args2; | 1216 | Lisp_Object val, *args2; |
| 1214 | struct gcpro gcpro1; | 1217 | struct gcpro gcpro1; |
| 1215 | 1218 | ||
| 1216 | if (!NILP (Vcoding_system_for_read)) | 1219 | val = Vcoding_system_for_read; |
| 1217 | val = Vcoding_system_for_read; | 1220 | if (NILP (val)) |
| 1218 | else if (!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters) | ||
| 1219 | || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters))) | ||
| 1220 | /* The user will normally expect EOL conversion to take place, so | ||
| 1221 | specify `raw-text' as the decoding system; when that is not | ||
| 1222 | desired, the process coding system should be set explicitly to | ||
| 1223 | `no-conversion'. The encoding system will be updated to match | ||
| 1224 | when the EOL convention has been established, which seems | ||
| 1225 | reasonable. */ | ||
| 1226 | val = Qraw_text; | ||
| 1227 | else | ||
| 1228 | { | 1221 | { |
| 1229 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); | 1222 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); |
| 1230 | args2[0] = Qstart_process; | 1223 | args2[0] = Qstart_process; |
| @@ -1236,17 +1229,11 @@ Remaining arguments are strings to give program as arguments.") | |||
| 1236 | val = XCONS (coding_systems)->car; | 1229 | val = XCONS (coding_systems)->car; |
| 1237 | else if (CONSP (Vdefault_process_coding_system)) | 1230 | else if (CONSP (Vdefault_process_coding_system)) |
| 1238 | val = XCONS (Vdefault_process_coding_system)->car; | 1231 | val = XCONS (Vdefault_process_coding_system)->car; |
| 1239 | else | ||
| 1240 | val = Qnil; | ||
| 1241 | } | 1232 | } |
| 1242 | XPROCESS (proc)->decode_coding_system = val; | 1233 | XPROCESS (proc)->decode_coding_system = val; |
| 1243 | 1234 | ||
| 1244 | if (!NILP (Vcoding_system_for_write)) | 1235 | val = Vcoding_system_for_write; |
| 1245 | val = Vcoding_system_for_write; | 1236 | if (NILP (val)) |
| 1246 | else if (!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters) | ||
| 1247 | || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters))) | ||
| 1248 | val = Qnil; | ||
| 1249 | else | ||
| 1250 | { | 1237 | { |
| 1251 | if (EQ (coding_systems, Qt)) | 1238 | if (EQ (coding_systems, Qt)) |
| 1252 | { | 1239 | { |
| @@ -1261,8 +1248,6 @@ Remaining arguments are strings to give program as arguments.") | |||
| 1261 | val = XCONS (coding_systems)->cdr; | 1248 | val = XCONS (coding_systems)->cdr; |
| 1262 | else if (CONSP (Vdefault_process_coding_system)) | 1249 | else if (CONSP (Vdefault_process_coding_system)) |
| 1263 | val = XCONS (Vdefault_process_coding_system)->cdr; | 1250 | val = XCONS (Vdefault_process_coding_system)->cdr; |
| 1264 | else | ||
| 1265 | val = Qnil; | ||
| 1266 | } | 1251 | } |
| 1267 | XPROCESS (proc)->encode_coding_system = val; | 1252 | XPROCESS (proc)->encode_coding_system = val; |
| 1268 | } | 1253 | } |
| @@ -1356,6 +1341,7 @@ create_process (process, new_argv, current_dir) | |||
| 1356 | volatile int forkin, forkout; | 1341 | volatile int forkin, forkout; |
| 1357 | volatile int pty_flag = 0; | 1342 | volatile int pty_flag = 0; |
| 1358 | extern char **environ; | 1343 | extern char **environ; |
| 1344 | Lisp_Object buffer = XPROCESS (process)->buffer; | ||
| 1359 | 1345 | ||
| 1360 | inchannel = outchannel = -1; | 1346 | inchannel = outchannel = -1; |
| 1361 | 1347 | ||
| @@ -1450,6 +1436,20 @@ create_process (process, new_argv, current_dir) | |||
| 1450 | setup_coding_system (XPROCESS (process)->encode_coding_system, | 1436 | setup_coding_system (XPROCESS (process)->encode_coding_system, |
| 1451 | proc_encode_coding_system[outchannel]); | 1437 | proc_encode_coding_system[outchannel]); |
| 1452 | 1438 | ||
| 1439 | if (!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters) | ||
| 1440 | || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters))) | ||
| 1441 | { | ||
| 1442 | /* In unibyte mode, character code conversion should not take | ||
| 1443 | place but EOL conversion should. So, setup raw-text or one | ||
| 1444 | of the subsidiary according to the information just setup. */ | ||
| 1445 | if (NILP (Vcoding_system_for_read) | ||
| 1446 | && !NILP (XPROCESS (process)->decode_coding_system)) | ||
| 1447 | setup_raw_text_coding_system (proc_decode_coding_system[inchannel]); | ||
| 1448 | if (NILP (Vcoding_system_for_write) | ||
| 1449 | && !NILP (XPROCESS (process)->encode_coding_system)) | ||
| 1450 | setup_raw_text_coding_system (proc_decode_coding_system[outchannel]); | ||
| 1451 | } | ||
| 1452 | |||
| 1453 | if (CODING_REQUIRE_ENCODING (proc_encode_coding_system[outchannel])) | 1453 | if (CODING_REQUIRE_ENCODING (proc_encode_coding_system[outchannel])) |
| 1454 | { | 1454 | { |
| 1455 | /* Here we encode arguments by the coding system used for | 1455 | /* Here we encode arguments by the coding system used for |