aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-10 19:21:05 +0000
committerRichard M. Stallman1998-05-10 19:21:05 +0000
commit6791894163b135c73145f2f0f2fcb6e7bb711aab (patch)
tree1dd8df40c5eb426e2ede50f1a2a970d4b71636f1
parent63c7727f83b8b21a0ea3e0582d5d1732f77065f7 (diff)
downloademacs-6791894163b135c73145f2f0f2fcb6e7bb711aab.tar.gz
emacs-6791894163b135c73145f2f0f2fcb6e7bb711aab.zip
(Fstart_process): Remove the special case for
unibyte, for initializing the process coding systems. Instead, use the normal multibyte code, but check BUFFER's value and the default value of enable-multibyte-characters. (Fopen_network_stream): Likewise.
-rw-r--r--src/process.c234
1 files changed, 114 insertions, 120 deletions
diff --git a/src/process.c b/src/process.c
index 601b86bbee1..305a6780e41 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1206,66 +1206,66 @@ Remaining arguments are strings to give program as arguments.")
1206 BUF_ZV (XBUFFER (buffer)), 1206 BUF_ZV (XBUFFER (buffer)),
1207 BUF_ZV_BYTE (XBUFFER (buffer))); 1207 BUF_ZV_BYTE (XBUFFER (buffer)));
1208 1208
1209 if (!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters) 1209 {
1210 || NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters)) 1210 /* Setup coding systems for communicating with the process. */
1211 { 1211 /* Qt denotes we have not yet called Ffind_operation_coding_system. */
1212 XPROCESS (proc)->decode_coding_system = Qnil; 1212 Lisp_Object coding_systems = Qt;
1213 XPROCESS (proc)->encode_coding_system = Qnil; 1213 Lisp_Object val, *args2;
1214 } 1214 struct gcpro gcpro1;
1215 else 1215
1216 { 1216 if (!NILP (Vcoding_system_for_read))
1217 /* Setup coding systems for communicating with the process. */ 1217 val = Vcoding_system_for_read;
1218 /* Qt denotes we have not yet called Ffind_operation_coding_system. */ 1218 else if (!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters)
1219 Lisp_Object coding_systems = Qt; 1219 || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters)))
1220 Lisp_Object val, *args2; 1220 /* The user will normally expect EOL conversion to take place, so
1221 struct gcpro gcpro1; 1221 specify `raw-text' as the decoding system; when that is not
1222 1222 desired, the process coding system should be set explicitly to
1223 if (!NILP (Vcoding_system_for_read)) 1223 `no-conversion'. The encoding system will be updated to match
1224 val = Vcoding_system_for_read; 1224 when the EOL convention has been established, which seems
1225 else if (NILP (current_buffer->enable_multibyte_characters)) 1225 reasonable. */
1226 val = Qraw_text; 1226 val = Qraw_text;
1227 else 1227 else
1228 { 1228 {
1229 args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); 1229 args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2);
1230 args2[0] = Qstart_process; 1230 args2[0] = Qstart_process;
1231 for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; 1231 for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
1232 GCPRO1 (proc); 1232 GCPRO1 (proc);
1233 coding_systems = Ffind_operation_coding_system (nargs + 1, args2); 1233 coding_systems = Ffind_operation_coding_system (nargs + 1, args2);
1234 UNGCPRO; 1234 UNGCPRO;
1235 if (CONSP (coding_systems)) 1235 if (CONSP (coding_systems))
1236 val = XCONS (coding_systems)->car; 1236 val = XCONS (coding_systems)->car;
1237 else if (CONSP (Vdefault_process_coding_system)) 1237 else if (CONSP (Vdefault_process_coding_system))
1238 val = XCONS (Vdefault_process_coding_system)->car; 1238 val = XCONS (Vdefault_process_coding_system)->car;
1239 else 1239 else
1240 val = Qnil; 1240 val = Qnil;
1241 } 1241 }
1242 XPROCESS (proc)->decode_coding_system = val; 1242 XPROCESS (proc)->decode_coding_system = val;
1243 1243
1244 if (!NILP (Vcoding_system_for_write)) 1244 if (!NILP (Vcoding_system_for_write))
1245 val = Vcoding_system_for_write; 1245 val = Vcoding_system_for_write;
1246 else if (NILP (current_buffer->enable_multibyte_characters)) 1246 else if (!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters)
1247 val = Qnil; 1247 || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters)))
1248 else 1248 val = Qnil;
1249 { 1249 else
1250 if (EQ (coding_systems, Qt)) 1250 {
1251 { 1251 if (EQ (coding_systems, Qt))
1252 args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof args2); 1252 {
1253 args2[0] = Qstart_process; 1253 args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof args2);
1254 for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; 1254 args2[0] = Qstart_process;
1255 GCPRO1 (proc); 1255 for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
1256 coding_systems = 1256 GCPRO1 (proc);
1257 Ffind_operation_coding_system (nargs + 1, args2); 1257 coding_systems = Ffind_operation_coding_system (nargs + 1, args2);
1258 UNGCPRO; 1258 UNGCPRO;
1259 } 1259 }
1260 if (CONSP (coding_systems)) 1260 if (CONSP (coding_systems))
1261 val = XCONS (coding_systems)->cdr; 1261 val = XCONS (coding_systems)->cdr;
1262 else if (CONSP (Vdefault_process_coding_system)) 1262 else if (CONSP (Vdefault_process_coding_system))
1263 val = XCONS (Vdefault_process_coding_system)->cdr; 1263 val = XCONS (Vdefault_process_coding_system)->cdr;
1264 else 1264 else
1265 val = Qnil; 1265 val = Qnil;
1266 } 1266 }
1267 XPROCESS (proc)->encode_coding_system = val; 1267 XPROCESS (proc)->encode_coding_system = val;
1268 } 1268 }
1269 1269
1270 XPROCESS (proc)->decoding_buf = make_uninit_string (0); 1270 XPROCESS (proc)->decoding_buf = make_uninit_string (0);
1271 XPROCESS (proc)->decoding_carryover = make_number (0); 1271 XPROCESS (proc)->decoding_carryover = make_number (0);
@@ -1988,67 +1988,61 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
1988 if (inch > max_process_desc) 1988 if (inch > max_process_desc)
1989 max_process_desc = inch; 1989 max_process_desc = inch;
1990 1990
1991 if (!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters) 1991 {
1992 || NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters)) 1992 /* Setup coding systems for communicating with the network stream. */
1993 { 1993 struct gcpro gcpro1;
1994 XPROCESS (proc)->decode_coding_system = Qnil; 1994 /* Qt denotes we have not yet called Ffind_operation_coding_system. */
1995 XPROCESS (proc)->encode_coding_system = Qnil; 1995 Lisp_Object coding_systems = Qt;
1996 } 1996 Lisp_Object args[5], val;
1997 else 1997
1998 { 1998 if (!NILP (Vcoding_system_for_read))
1999 /* Setup coding systems for communicating with the network stream. */ 1999 val = Vcoding_system_for_read;
2000 struct gcpro gcpro1; 2000 else if (!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters)
2001 /* Qt denotes we have not yet called Ffind_operation_coding_system. */ 2001 || NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters))
2002 Lisp_Object coding_systems = Qt; 2002 /* We dare not decode end-of-line format by setting VAL to
2003 Lisp_Object args[5], val; 2003 Qraw_text, because the existing Emacs Lisp libraries
2004 2004 assume that they receive bare code including a sequene of
2005 if (!NILP (Vcoding_system_for_read)) 2005 CR LF. */
2006 val = Vcoding_system_for_read; 2006 val = Qnil;
2007 else if (NILP (current_buffer->enable_multibyte_characters)) 2007 else
2008 /* We dare not decode end-of-line format by setting VAL to 2008 {
2009 Qraw_text, because the existing Emacs Lisp libraries 2009 args[0] = Qopen_network_stream, args[1] = name,
2010 assume that they receive bare code including a sequene of 2010 args[2] = buffer, args[3] = host, args[4] = service;
2011 CR LF. */ 2011 GCPRO1 (proc);
2012 val = Qnil; 2012 coding_systems = Ffind_operation_coding_system (5, args);
2013 else 2013 UNGCPRO;
2014 { 2014 if (CONSP (coding_systems))
2015 args[0] = Qopen_network_stream, args[1] = name, 2015 val = XCONS (coding_systems)->car;
2016 args[2] = buffer, args[3] = host, args[4] = service; 2016 else if (CONSP (Vdefault_process_coding_system))
2017 GCPRO1 (proc); 2017 val = XCONS (Vdefault_process_coding_system)->car;
2018 coding_systems = Ffind_operation_coding_system (5, args); 2018 else
2019 UNGCPRO; 2019 val = Qnil;
2020 if (CONSP (coding_systems)) 2020 }
2021 val = XCONS (coding_systems)->car; 2021 XPROCESS (proc)->decode_coding_system = val;
2022 else if (CONSP (Vdefault_process_coding_system))
2023 val = XCONS (Vdefault_process_coding_system)->car;
2024 else
2025 val = Qnil;
2026 }
2027 XPROCESS (proc)->decode_coding_system = val;
2028 2022
2029 if (!NILP (Vcoding_system_for_write)) 2023 if (!NILP (Vcoding_system_for_write))
2030 val = Vcoding_system_for_write; 2024 val = Vcoding_system_for_write;
2031 else if (NILP (current_buffer->enable_multibyte_characters)) 2025 else if (NILP (current_buffer->enable_multibyte_characters))
2032 val = Qnil; 2026 val = Qnil;
2033 else 2027 else
2034 { 2028 {
2035 if (EQ (coding_systems, Qt)) 2029 if (EQ (coding_systems, Qt))
2036 { 2030 {
2037 args[0] = Qopen_network_stream, args[1] = name, 2031 args[0] = Qopen_network_stream, args[1] = name,
2038 args[2] = buffer, args[3] = host, args[4] = service; 2032 args[2] = buffer, args[3] = host, args[4] = service;
2039 GCPRO1 (proc); 2033 GCPRO1 (proc);
2040 coding_systems = Ffind_operation_coding_system (5, args); 2034 coding_systems = Ffind_operation_coding_system (5, args);
2041 UNGCPRO; 2035 UNGCPRO;
2042 } 2036 }
2043 if (CONSP (coding_systems)) 2037 if (CONSP (coding_systems))
2044 val = XCONS (coding_systems)->cdr; 2038 val = XCONS (coding_systems)->cdr;
2045 else if (CONSP (Vdefault_process_coding_system)) 2039 else if (CONSP (Vdefault_process_coding_system))
2046 val = XCONS (Vdefault_process_coding_system)->cdr; 2040 val = XCONS (Vdefault_process_coding_system)->cdr;
2047 else 2041 else
2048 val = Qnil; 2042 val = Qnil;
2049 } 2043 }
2050 XPROCESS (proc)->encode_coding_system = val; 2044 XPROCESS (proc)->encode_coding_system = val;
2051 } 2045 }
2052 2046
2053 if (!proc_decode_coding_system[inch]) 2047 if (!proc_decode_coding_system[inch])
2054 proc_decode_coding_system[inch] 2048 proc_decode_coding_system[inch]