aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorKenichi Handa2000-08-24 02:06:43 +0000
committerKenichi Handa2000-08-24 02:06:43 +0000
commit278bfdd6150ca5d3ae946fb8a79531188d52fcea (patch)
treecb531739bff13aa6eb2a0ba09df17eb9862f5824 /src/process.c
parent5a76406cf3a19ed0c78c8050dd42fff7d7b1809f (diff)
downloademacs-278bfdd6150ca5d3ae946fb8a79531188d52fcea.tar.gz
emacs-278bfdd6150ca5d3ae946fb8a79531188d52fcea.zip
(create_process): Don't setup raw-text coding here.
(Fopen_network_stream): Don't set coding->src_multibyte and coding->dst_multibyte here. (read_process_output): For process filter, return unibyte string if default-enable-multibyte-characters is nil. (send_process): If OBJECT is multibyte text, be sure to encoded it by the specified coding system for the process. Otherwise, setup raw-text coding. (init_process): Don't initialize default-process-coding-system here.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/process.c b/src/process.c
index d71b68288cd..35fca18ff28 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1410,18 +1410,6 @@ create_process (process, new_argv, current_dir)
1410 setup_coding_system (XPROCESS (process)->encode_coding_system, 1410 setup_coding_system (XPROCESS (process)->encode_coding_system,
1411 proc_encode_coding_system[outchannel]); 1411 proc_encode_coding_system[outchannel]);
1412 1412
1413 if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters))
1414 || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters)))
1415 {
1416 /* In unibyte mode, character code conversion should not take
1417 place but EOL conversion should. So, setup raw-text or one
1418 of the subsidiary according to the information just setup. */
1419 if (!NILP (XPROCESS (process)->decode_coding_system))
1420 setup_raw_text_coding_system (proc_decode_coding_system[inchannel]);
1421 if (!NILP (XPROCESS (process)->encode_coding_system))
1422 setup_raw_text_coding_system (proc_encode_coding_system[outchannel]);
1423 }
1424
1425 /* Delay interrupts until we have a chance to store 1413 /* Delay interrupts until we have a chance to store
1426 the new fork's pid in its process structure */ 1414 the new fork's pid in its process structure */
1427#ifdef POSIX_SIGNALS 1415#ifdef POSIX_SIGNALS
@@ -2109,15 +2097,11 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
2109 = (struct coding_system *) xmalloc (sizeof (struct coding_system)); 2097 = (struct coding_system *) xmalloc (sizeof (struct coding_system));
2110 setup_coding_system (XPROCESS (proc)->decode_coding_system, 2098 setup_coding_system (XPROCESS (proc)->decode_coding_system,
2111 proc_decode_coding_system[inch]); 2099 proc_decode_coding_system[inch]);
2112 proc_decode_coding_system[inch]->src_multibyte = 1;
2113 proc_decode_coding_system[inch]->dst_multibyte = 0;
2114 if (!proc_encode_coding_system[outch]) 2100 if (!proc_encode_coding_system[outch])
2115 proc_encode_coding_system[outch] 2101 proc_encode_coding_system[outch]
2116 = (struct coding_system *) xmalloc (sizeof (struct coding_system)); 2102 = (struct coding_system *) xmalloc (sizeof (struct coding_system));
2117 setup_coding_system (XPROCESS (proc)->encode_coding_system, 2103 setup_coding_system (XPROCESS (proc)->encode_coding_system,
2118 proc_encode_coding_system[outch]); 2104 proc_encode_coding_system[outch]);
2119 proc_encode_coding_system[inch]->src_multibyte = 0;
2120 proc_encode_coding_system[inch]->dst_multibyte = 1;
2121 2105
2122 XPROCESS (proc)->decoding_buf = make_uninit_string (0); 2106 XPROCESS (proc)->decoding_buf = make_uninit_string (0);
2123 XPROCESS (proc)->decoding_carryover = make_number (0); 2107 XPROCESS (proc)->decoding_carryover = make_number (0);
@@ -2956,6 +2940,10 @@ read_process_output (proc, channel)
2956 2940
2957 text = decode_coding_string (make_unibyte_string (chars, nbytes), 2941 text = decode_coding_string (make_unibyte_string (chars, nbytes),
2958 coding, 0); 2942 coding, 0);
2943 if (NILP (buffer_defaults.enable_multibyte_characters))
2944 /* We had better return unibyte string. */
2945 text = string_make_unibyte (text);
2946
2959 Vlast_coding_system_used = coding->symbol; 2947 Vlast_coding_system_used = coding->symbol;
2960 /* A new coding system might be found. */ 2948 /* A new coding system might be found. */
2961 if (!EQ (p->decode_coding_system, coding->symbol)) 2949 if (!EQ (p->decode_coding_system, coding->symbol))
@@ -3201,7 +3189,25 @@ send_process (proc, buf, len, object)
3201 if ((STRINGP (object) && STRING_MULTIBYTE (object)) 3189 if ((STRINGP (object) && STRING_MULTIBYTE (object))
3202 || (BUFFERP (object) 3190 || (BUFFERP (object)
3203 && !NILP (XBUFFER (object)->enable_multibyte_characters))) 3191 && !NILP (XBUFFER (object)->enable_multibyte_characters)))
3204 coding->src_multibyte = 1; 3192 {
3193 coding->src_multibyte = 1;
3194 if (!EQ (coding->symbol, XPROCESS (proc)->encode_coding_system))
3195 /* The coding system for encoding was changed to raw-text
3196 because we sent a unibyte text previously. Now we are
3197 sending a multibyte text, thus we must encode it by the
3198 original coding system specified for the current
3199 process. */
3200 setup_coding_system (XPROCESS (proc)->encode_coding_system,
3201 coding);
3202 }
3203 else
3204 {
3205 coding->src_multibyte = 0;
3206 /* For sending a unibyte text, character code conversion
3207 should not take place but EOL conversion should. So, setup
3208 raw-text or one of the subsidiary. */
3209 setup_raw_text_coding_system (coding);
3210 }
3205 coding->dst_multibyte = 0; 3211 coding->dst_multibyte = 0;
3206 3212
3207 if (CODING_REQUIRE_ENCODING (coding)) 3213 if (CODING_REQUIRE_ENCODING (coding))
@@ -4507,11 +4513,6 @@ init_process ()
4507 } 4513 }
4508 bzero (proc_decode_coding_system, sizeof proc_decode_coding_system); 4514 bzero (proc_decode_coding_system, sizeof proc_decode_coding_system);
4509 bzero (proc_encode_coding_system, sizeof proc_encode_coding_system); 4515 bzero (proc_encode_coding_system, sizeof proc_encode_coding_system);
4510
4511 Vdefault_process_coding_system
4512 = (NILP (buffer_defaults.enable_multibyte_characters)
4513 ? Fcons (Qraw_text, Qnil)
4514 : Fcons (Qemacs_mule, Qnil));
4515} 4516}
4516 4517
4517void 4518void