diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/coding.c | 2 | ||||
| -rw-r--r-- | src/insdel.c | 15 |
3 files changed, 16 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2779e5a6ea8..2498bc8c974 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-03-21 Kenichi Handa <handa@gnu.org> | ||
| 2 | |||
| 3 | * coding.c (syms_of_coding): Cancel previous change. | ||
| 4 | |||
| 5 | * insdel.c (insert_from_gap): Fix previous change. | ||
| 6 | |||
| 1 | 2013-03-20 Kenichi Handa <handa@gnu.org> | 7 | 2013-03-20 Kenichi Handa <handa@gnu.org> |
| 2 | 8 | ||
| 3 | * coding.c (syms_of_coding): Initialize disable_ascii_optimization | 9 | * 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. */); | |||
| 10877 | DEFVAR_BOOL ("disable-ascii-optimization", disable_ascii_optimization, | 10877 | DEFVAR_BOOL ("disable-ascii-optimization", disable_ascii_optimization, |
| 10878 | doc: /* If non-nil, Emacs does not optimize code decoder for ASCII files. | 10878 | doc: /* If non-nil, Emacs does not optimize code decoder for ASCII files. |
| 10879 | Internal use only. Removed after the experimental optimizer gets stable. */); | 10879 | Internal use only. Removed after the experimental optimizer gets stable. */); |
| 10880 | disable_ascii_optimization = 1; | 10880 | disable_ascii_optimization = 0; |
| 10881 | 10881 | ||
| 10882 | DEFVAR_LISP ("translation-table-for-input", Vtranslation_table_for_input, | 10882 | DEFVAR_LISP ("translation-table-for-input", Vtranslation_table_for_input, |
| 10883 | doc: /* Char table for translating self-inserting characters. | 10883 | 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, | |||
| 983 | void | 983 | void |
| 984 | insert_from_gap (ptrdiff_t nchars, ptrdiff_t nbytes, bool text_at_gap_tail) | 984 | insert_from_gap (ptrdiff_t nchars, ptrdiff_t nbytes, bool text_at_gap_tail) |
| 985 | { | 985 | { |
| 986 | int ins_charpos = GPT; | ||
| 987 | int ins_bytepos = GPT_BYTE; | ||
| 988 | |||
| 986 | if (NILP (BVAR (current_buffer, enable_multibyte_characters))) | 989 | if (NILP (BVAR (current_buffer, enable_multibyte_characters))) |
| 987 | nchars = nbytes; | 990 | nchars = nbytes; |
| 988 | 991 | ||
| @@ -1003,18 +1006,18 @@ insert_from_gap (ptrdiff_t nchars, ptrdiff_t nbytes, bool text_at_gap_tail) | |||
| 1003 | 1006 | ||
| 1004 | eassert (GPT <= GPT_BYTE); | 1007 | eassert (GPT <= GPT_BYTE); |
| 1005 | 1008 | ||
| 1006 | adjust_overlays_for_insert (GPT - nchars, nchars); | 1009 | adjust_overlays_for_insert (ins_charpos, nchars); |
| 1007 | adjust_markers_for_insert (GPT - nchars, GPT_BYTE - nbytes, | 1010 | adjust_markers_for_insert (ins_charpos, ins_bytepos, |
| 1008 | GPT, GPT_BYTE, 0); | 1011 | ins_charpos + nchars, ins_bytepos + nbytes, 0); |
| 1009 | 1012 | ||
| 1010 | if (buffer_intervals (current_buffer)) | 1013 | if (buffer_intervals (current_buffer)) |
| 1011 | { | 1014 | { |
| 1012 | offset_intervals (current_buffer, GPT - nchars, nchars); | 1015 | offset_intervals (current_buffer, ins_charpos, nchars); |
| 1013 | graft_intervals_into_buffer (NULL, GPT - nchars, nchars, | 1016 | graft_intervals_into_buffer (NULL, ins_charpos, nchars, |
| 1014 | current_buffer, 0); | 1017 | current_buffer, 0); |
| 1015 | } | 1018 | } |
| 1016 | 1019 | ||
| 1017 | if (! text_at_gap_tail && GPT - nchars < PT) | 1020 | if (ins_charpos < PT) |
| 1018 | adjust_point (nchars, nbytes); | 1021 | adjust_point (nchars, nbytes); |
| 1019 | 1022 | ||
| 1020 | check_markers (); | 1023 | check_markers (); |