From: Miles Bader Date: Sun, 15 Jul 2007 04:47:46 +0000 (+0000) Subject: Merge from emacs--devo--0 X-Git-Tag: emacs-pretest-23.0.90~8295^2~377 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8c406a9bc42ee77fcbbb4201fe8bda855eafd832;p=emacs.git Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 806-813) - Merge from emacs--rel--22 - Update from CVS * emacs--rel--22 (patch 51-58) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 233-236) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-230 --- 8c406a9bc42ee77fcbbb4201fe8bda855eafd832 diff --cc src/process.c index 067eae7f286,5f96467a681..5551c0610d0 --- a/src/process.c +++ b/src/process.c @@@ -679,9 -671,8 +671,9 @@@ setup_process_coding_systems (process Lisp_Object process; { struct Lisp_Process *p = XPROCESS (process); - int inch = XINT (p->infd); - int outch = XINT (p->outfd); + int inch = p->infd; + int outch = p->outfd; + Lisp_Object coding_system; if (inch < 0 || outch < 0) return; @@@ -689,11 -680,12 +681,11 @@@ if (!proc_decode_coding_system[inch]) proc_decode_coding_system[inch] = (struct coding_system *) xmalloc (sizeof (struct coding_system)); - setup_coding_system (p->decode_coding_system, - proc_decode_coding_system[inch]); + coding_system = p->decode_coding_system; if (! NILP (p->filter)) { - if (NILP (p->filter_multibyte)) + if (!p->filter_multibyte) - setup_raw_text_coding_system (proc_decode_coding_system[inch]); + coding_system = raw_text_coding_system (coding_system); } else if (BUFFERP (p->buffer)) { @@@ -5169,25 -5159,29 +5158,25 @@@ read_process_output (proc, channel valid memory because p->outfd will be changed once EOF is sent to the process. */ if (NILP (p->encode_coding_system) - && proc_encode_coding_system[XINT (p->outfd)]) + && proc_encode_coding_system[p->outfd]) { - p->encode_coding_system = coding->symbol; - setup_coding_system (coding->symbol, + p->encode_coding_system + = coding_inherit_eol_type (Vlast_coding_system_used, Qnil); + setup_coding_system (p->encode_coding_system, - proc_encode_coding_system[XINT (p->outfd)]); + proc_encode_coding_system[p->outfd]); - if (proc_encode_coding_system[p->outfd]->eol_type - == CODING_EOL_UNDECIDED) - proc_encode_coding_system[p->outfd]->eol_type - = system_eol_type; } } - carryover = nbytes - coding->consumed; - if (carryover < 0) - abort (); - - if (SCHARS (p->decoding_buf) < carryover) - p->decoding_buf = make_uninit_string (carryover); - bcopy (chars + coding->consumed, SDATA (p->decoding_buf), - carryover); - p->decoding_carryover = carryover; + if (coding->carryover_bytes > 0) + { + if (SCHARS (p->decoding_buf) < coding->carryover_bytes) + p->decoding_buf = make_uninit_string (coding->carryover_bytes); + bcopy (coding->carryover, SDATA (p->decoding_buf), + coding->carryover_bytes); - XSETINT (p->decoding_carryover, coding->carryover_bytes); ++ p->decoding_carryover = coding->carryover_bytes; + } /* Adjust the multibyteness of TEXT to that of the filter. */ - if (NILP (p->filter_multibyte) != ! STRING_MULTIBYTE (text)) + if (p->filter_multibyte != STRING_MULTIBYTE (text)) text = (STRING_MULTIBYTE (text) ? Fstring_as_unibyte (text) : Fstring_to_multibyte (text)); @@@ -5270,31 -5264,36 +5259,31 @@@ if (! (BEGV <= PT && PT <= ZV)) Fwiden (); - text = decode_coding_string (make_unibyte_string (chars, nbytes), - coding, 0); - Vlast_coding_system_used = coding->symbol; + decode_coding_c_string (coding, chars, nbytes, Qt); + text = coding->dst_object; + Vlast_coding_system_used = CODING_ID_NAME (coding->id); /* A new coding system might be found. See the comment in the similar code in the previous `if' block. */ - if (!EQ (p->decode_coding_system, coding->symbol)) + if (!EQ (p->decode_coding_system, Vlast_coding_system_used)) { - p->decode_coding_system = coding->symbol; + p->decode_coding_system = Vlast_coding_system_used; if (NILP (p->encode_coding_system) - && proc_encode_coding_system[XINT (p->outfd)]) + && proc_encode_coding_system[p->outfd]) { - p->encode_coding_system = coding->symbol; - setup_coding_system (coding->symbol, + p->encode_coding_system + = coding_inherit_eol_type (Vlast_coding_system_used, Qnil); + setup_coding_system (p->encode_coding_system, - proc_encode_coding_system[XINT (p->outfd)]); + proc_encode_coding_system[p->outfd]); - if (proc_encode_coding_system[p->outfd]->eol_type - == CODING_EOL_UNDECIDED) - proc_encode_coding_system[p->outfd]->eol_type - = system_eol_type; } } - carryover = nbytes - coding->consumed; - if (carryover < 0) - abort (); - - if (SCHARS (p->decoding_buf) < carryover) - p->decoding_buf = make_uninit_string (carryover); - bcopy (chars + coding->consumed, SDATA (p->decoding_buf), - carryover); - p->decoding_carryover = carryover; - + if (coding->carryover_bytes > 0) + { + if (SCHARS (p->decoding_buf) < coding->carryover_bytes) + p->decoding_buf = make_uninit_string (coding->carryover_bytes); + bcopy (coding->carryover, SDATA (p->decoding_buf), + coding->carryover_bytes); - XSETINT (p->decoding_carryover, coding->carryover_bytes); ++ p->decoding_carryover = coding->carryover_bytes; + } /* Adjust the multibyteness of TEXT to that of the buffer. */ if (NILP (current_buffer->enable_multibyte_characters) != ! STRING_MULTIBYTE (text)) @@@ -5412,11 -5411,11 +5401,11 @@@ send_process (proc, buf, len, object update_status (p); if (! EQ (p->status, Qrun)) error ("Process %s not running", SDATA (p->name)); - if (XINT (p->outfd) < 0) + if (p->outfd < 0) error ("Output file descriptor of %s is closed", SDATA (p->name)); - coding = proc_encode_coding_system[XINT (p->outfd)]; + coding = proc_encode_coding_system[p->outfd]; - Vlast_coding_system_used = coding->symbol; + Vlast_coding_system_used = CODING_ID_NAME (coding->id); if ((STRINGP (object) && STRING_MULTIBYTE (object)) || (BUFFERP (object)