aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorJuanma Barranquero2010-10-08 12:14:47 +0200
committerJuanma Barranquero2010-10-08 12:14:47 +0200
commit4628bef1eea0f60e846fe6b6591725aa92952de9 (patch)
tree9d137b8e0964c0b1ebc4afb4e743e35b807d048d /src/process.c
parent24ac444fbe5d76a7cf09a62b741b9e956ab90d3e (diff)
parent2b7c934285417d2eac7a3c603231d22ce7e212d8 (diff)
downloademacs-4628bef1eea0f60e846fe6b6591725aa92952de9.tar.gz
emacs-4628bef1eea0f60e846fe6b6591725aa92952de9.zip
Merge changes from emacs-23 branch.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/process.c b/src/process.c
index 370fb673e84..e1515065957 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1670,6 +1670,11 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1670 val = XCDR (Vdefault_process_coding_system); 1670 val = XCDR (Vdefault_process_coding_system);
1671 } 1671 }
1672 XPROCESS (proc)->encode_coding_system = val; 1672 XPROCESS (proc)->encode_coding_system = val;
1673 /* Note: At this momemnt, the above coding system may leave
1674 text-conversion or eol-conversion unspecified. They will be
1675 decided after we read output from the process and decode it by
1676 some coding system, or just before we actually send a text to
1677 the process. */
1673 } 1678 }
1674 1679
1675 1680
@@ -1712,6 +1717,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1712 tem = Fsubstring (tem, make_number (2), Qnil); 1717 tem = Fsubstring (tem, make_number (2), Qnil);
1713 1718
1714 { 1719 {
1720 Lisp_Object arg_encoding = Qnil;
1715 struct gcpro gcpro1; 1721 struct gcpro gcpro1;
1716 GCPRO1 (tem); 1722 GCPRO1 (tem);
1717 1723
@@ -1729,9 +1735,14 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1729 tem = Fcons (args[i], tem); 1735 tem = Fcons (args[i], tem);
1730 CHECK_STRING (XCAR (tem)); 1736 CHECK_STRING (XCAR (tem));
1731 if (STRING_MULTIBYTE (XCAR (tem))) 1737 if (STRING_MULTIBYTE (XCAR (tem)))
1732 XSETCAR (tem, 1738 {
1733 code_convert_string_norecord 1739 if (NILP (arg_encoding))
1734 (XCAR (tem), XPROCESS (proc)->encode_coding_system, 1)); 1740 arg_encoding = (complement_process_encoding_system
1741 (XPROCESS (proc)->encode_coding_system));
1742 XSETCAR (tem,
1743 code_convert_string_norecord
1744 (XCAR (tem), arg_encoding, 1));
1745 }
1735 } 1746 }
1736 1747
1737 UNGCPRO; 1748 UNGCPRO;
@@ -5529,12 +5540,21 @@ send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,
5529 && !NILP (XBUFFER (object)->enable_multibyte_characters)) 5540 && !NILP (XBUFFER (object)->enable_multibyte_characters))
5530 || EQ (object, Qt)) 5541 || EQ (object, Qt))
5531 { 5542 {
5543 p->encode_coding_system
5544 = complement_process_encoding_system (p->encode_coding_system);
5532 if (!EQ (Vlast_coding_system_used, p->encode_coding_system)) 5545 if (!EQ (Vlast_coding_system_used, p->encode_coding_system))
5533 /* The coding system for encoding was changed to raw-text 5546 {
5534 because we sent a unibyte text previously. Now we are 5547 /* The coding system for encoding was changed to raw-text
5535 sending a multibyte text, thus we must encode it by the 5548 because we sent a unibyte text previously. Now we are
5536 original coding system specified for the current process. */ 5549 sending a multibyte text, thus we must encode it by the
5537 setup_coding_system (p->encode_coding_system, coding); 5550 original coding system specified for the current process.
5551
5552 Another reason we comming here is that the coding system
5553 was just complemented and new one was returned by
5554 complement_process_encoding_system. */
5555 setup_coding_system (p->encode_coding_system, coding);
5556 Vlast_coding_system_used = p->encode_coding_system;
5557 }
5538 coding->src_multibyte = 1; 5558 coding->src_multibyte = 1;
5539 } 5559 }
5540 else 5560 else