comparison src/coding.c @ 83212:f70dc61a797f

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-581 Fix exec-shield autoconf test * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-582 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-583 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-584 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-585 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-586 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-587 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-588 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-589 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-590 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-591 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-592 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-38 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-39 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-40 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-41 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-252
author Karoly Lorentey <lorentey@elte.hu>
date Sun, 03 Oct 2004 13:08:55 +0000
parents 4a196c3bd2d8 9093a2e9c3fd
children 549734260e34
comparison
equal deleted inserted replaced
83211:b85b19b8eb65 83212:f70dc61a797f
5644 coding_save_composition (coding, from, to, Fcurrent_buffer ()); 5644 coding_save_composition (coding, from, to, Fcurrent_buffer ());
5645 else 5645 else
5646 coding_allocate_composition_data (coding, from); 5646 coding_allocate_composition_data (coding, from);
5647 } 5647 }
5648 5648
5649 /* Try to skip the heading and tailing ASCIIs. */ 5649 /* Try to skip the heading and tailing ASCIIs. We can't skip them
5650 if (coding->type != coding_type_ccl) 5650 if we must run CCL program or there are compositions to
5651 encode. */
5652 if (coding->type != coding_type_ccl
5653 && (! coding->cmp_data || coding->cmp_data->used == 0))
5651 { 5654 {
5652 int from_byte_orig = from_byte, to_byte_orig = to_byte; 5655 int from_byte_orig = from_byte, to_byte_orig = to_byte;
5653 5656
5654 if (from < GPT && GPT < to) 5657 if (from < GPT && GPT < to)
5655 move_gap_both (from, from_byte); 5658 move_gap_both (from, from_byte);
5661 coding->produced = len_byte; 5664 coding->produced = len_byte;
5662 coding->produced_char = len; 5665 coding->produced_char = len;
5663 if (!replace) 5666 if (!replace)
5664 /* We must record and adjust for this new text now. */ 5667 /* We must record and adjust for this new text now. */
5665 adjust_after_insert (from, from_byte_orig, to, to_byte_orig, len); 5668 adjust_after_insert (from, from_byte_orig, to, to_byte_orig, len);
5669 coding_free_composition_data (coding);
5666 return 0; 5670 return 0;
5667 } 5671 }
5668 5672
5669 head_skip = from_byte - from_byte_orig; 5673 head_skip = from_byte - from_byte_orig;
5670 tail_skip = to_byte_orig - to_byte; 5674 tail_skip = to_byte_orig - to_byte;
6291 } 6295 }
6292 6296
6293 if (coding->composing != COMPOSITION_DISABLED) 6297 if (coding->composing != COMPOSITION_DISABLED)
6294 coding_save_composition (coding, from, to, str); 6298 coding_save_composition (coding, from, to, str);
6295 6299
6296 /* Try to skip the heading and tailing ASCIIs. */ 6300 /* Try to skip the heading and tailing ASCIIs. We can't skip them
6297 if (coding->type != coding_type_ccl) 6301 if we must run CCL program or there are compositions to
6302 encode. */
6303 if (coding->type != coding_type_ccl
6304 && (! coding->cmp_data || coding->cmp_data->used == 0))
6298 { 6305 {
6299 SHRINK_CONVERSION_REGION (&from, &to_byte, coding, SDATA (str), 6306 SHRINK_CONVERSION_REGION (&from, &to_byte, coding, SDATA (str),
6300 1); 6307 1);
6301 if (from == to_byte) 6308 if (from == to_byte)
6302 return (nocopy ? str : Fcopy_sequence (str)); 6309 {
6310 coding_free_composition_data (coding);
6311 return (nocopy ? str : Fcopy_sequence (str));
6312 }
6303 shrinked_bytes = from + (SBYTES (str) - to_byte); 6313 shrinked_bytes = from + (SBYTES (str) - to_byte);
6304 } 6314 }
6305 6315
6306 len = encoding_buffer_size (coding, to_byte - from); 6316 len = encoding_buffer_size (coding, to_byte - from);
6307 allocate_conversion_buffer (buf, len); 6317 allocate_conversion_buffer (buf, len);