comparison src/process.c @ 110855:bec49af30c2f

Merge changes from emacs-23 branch.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 08 Oct 2010 12:14:47 +0200
parents 00fad82e2b50 4d672e9d91bf
children 32e6d2b445ce
comparison
equal deleted inserted replaced
110820:e60b0b3ed516 110855:bec49af30c2f
1668 val = XCDR (coding_systems); 1668 val = XCDR (coding_systems);
1669 else if (CONSP (Vdefault_process_coding_system)) 1669 else if (CONSP (Vdefault_process_coding_system))
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
1676 XPROCESS (proc)->decoding_buf = make_uninit_string (0); 1681 XPROCESS (proc)->decoding_buf = make_uninit_string (0);
1677 XPROCESS (proc)->decoding_carryover = 0; 1682 XPROCESS (proc)->decoding_carryover = 0;
1710 if (SBYTES (tem) > 2 && SREF (tem, 0) == '/' 1715 if (SBYTES (tem) > 2 && SREF (tem, 0) == '/'
1711 && SREF (tem, 1) == ':') 1716 && SREF (tem, 1) == ':')
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
1718 /* Encode the file name and put it in NEW_ARGV. 1724 /* Encode the file name and put it in NEW_ARGV.
1719 That's where the child will use it to execute the program. */ 1725 That's where the child will use it to execute the program. */
1727 for (i = 3; i < nargs; i++) 1733 for (i = 3; i < nargs; i++)
1728 { 1734 {
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;
1738 } 1749 }
1739 1750
5527 if ((STRINGP (object) && STRING_MULTIBYTE (object)) 5538 if ((STRINGP (object) && STRING_MULTIBYTE (object))
5528 || (BUFFERP (object) 5539 || (BUFFERP (object)
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
5541 { 5561 {
5542 /* For sending a unibyte text, character code conversion should 5562 /* For sending a unibyte text, character code conversion should