From: Kenichi Handa Date: Thu, 21 Mar 2013 15:18:44 +0000 (+0900) Subject: Fix a bug introduced by 2013-03-15T16:06:12Z!handa@gnu.org. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~529 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8bc369d4a23a3a8040d77e3ce89a7f63b1ecff97;p=emacs.git Fix a bug introduced by 2013-03-15T16:06:12Z!handa@gnu.org. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2779e5a6ea8..2498bc8c974 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2013-03-21 Kenichi Handa + + * coding.c (syms_of_coding): Cancel previous change. + + * insdel.c (insert_from_gap): Fix previous change. + 2013-03-20 Kenichi Handa * coding.c (syms_of_coding): Initialize disable_ascii_optimization diff --git a/src/coding.c b/src/coding.c index cb81375a043..8a09cd67859 100644 --- a/src/coding.c +++ b/src/coding.c @@ -10877,7 +10877,7 @@ decode text as usual. */); DEFVAR_BOOL ("disable-ascii-optimization", disable_ascii_optimization, doc: /* If non-nil, Emacs does not optimize code decoder for ASCII files. Internal use only. Removed after the experimental optimizer gets stable. */); - disable_ascii_optimization = 1; + disable_ascii_optimization = 0; DEFVAR_LISP ("translation-table-for-input", Vtranslation_table_for_input, doc: /* Char table for translating self-inserting characters. diff --git a/src/insdel.c b/src/insdel.c index a60fed0c32e..3dd81ffeb62 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -983,6 +983,9 @@ insert_from_string_1 (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, void insert_from_gap (ptrdiff_t nchars, ptrdiff_t nbytes, bool text_at_gap_tail) { + int ins_charpos = GPT; + int ins_bytepos = GPT_BYTE; + if (NILP (BVAR (current_buffer, enable_multibyte_characters))) nchars = nbytes; @@ -1003,18 +1006,18 @@ insert_from_gap (ptrdiff_t nchars, ptrdiff_t nbytes, bool text_at_gap_tail) eassert (GPT <= GPT_BYTE); - adjust_overlays_for_insert (GPT - nchars, nchars); - adjust_markers_for_insert (GPT - nchars, GPT_BYTE - nbytes, - GPT, GPT_BYTE, 0); + adjust_overlays_for_insert (ins_charpos, nchars); + adjust_markers_for_insert (ins_charpos, ins_bytepos, + ins_charpos + nchars, ins_bytepos + nbytes, 0); if (buffer_intervals (current_buffer)) { - offset_intervals (current_buffer, GPT - nchars, nchars); - graft_intervals_into_buffer (NULL, GPT - nchars, nchars, + offset_intervals (current_buffer, ins_charpos, nchars); + graft_intervals_into_buffer (NULL, ins_charpos, nchars, current_buffer, 0); } - if (! text_at_gap_tail && GPT - nchars < PT) + if (ins_charpos < PT) adjust_point (nchars, nbytes); check_markers ();