24 |
#include "lisp.h" |
#include "lisp.h" |
25 |
#include "intervals.h" |
#include "intervals.h" |
26 |
#include "buffer.h" |
#include "buffer.h" |
27 |
#include "charset.h" |
#include "character.h" |
28 |
#include "window.h" |
#include "window.h" |
29 |
#include "blockinput.h" |
#include "blockinput.h" |
30 |
#include "region-cache.h" |
#include "region-cache.h" |
670 |
int bytes_left = nbytes; |
int bytes_left = nbytes; |
671 |
Lisp_Object tbl = Qnil; |
Lisp_Object tbl = Qnil; |
672 |
|
|
|
/* We set the variable tbl to the reverse table of |
|
|
Vnonascii_translation_table in advance. */ |
|
|
if (CHAR_TABLE_P (Vnonascii_translation_table)) |
|
|
{ |
|
|
tbl = Fchar_table_extra_slot (Vnonascii_translation_table, |
|
|
make_number (0)); |
|
|
if (!CHAR_TABLE_P (tbl)) |
|
|
tbl = Qnil; |
|
|
} |
|
|
|
|
|
/* Convert multibyte to single byte. */ |
|
673 |
while (bytes_left > 0) |
while (bytes_left > 0) |
674 |
{ |
{ |
675 |
int thislen, c; |
int thislen, c; |
1034 |
|
|
1035 |
adjust_point (nchars, nbytes); |
adjust_point (nchars, nbytes); |
1036 |
|
|
1037 |
|
CHECK_MARKERS (); |
1038 |
|
} |
1039 |
|
|
1040 |
|
/* Insert a sequence of NCHARS chars which occupy NBYTES bytes |
1041 |
|
starting at GPT_ADDR. This funciton assumes PT == GPT. */ |
1042 |
|
|
1043 |
|
void |
1044 |
|
insert_from_gap (nchars, nbytes) |
1045 |
|
register int nchars, nbytes; |
1046 |
|
{ |
1047 |
|
if (PT != GPT) |
1048 |
|
abort (); |
1049 |
|
|
1050 |
|
if (NILP (current_buffer->enable_multibyte_characters)) |
1051 |
|
nchars = nbytes; |
1052 |
|
|
1053 |
|
MODIFF++; |
1054 |
|
|
1055 |
|
GAP_SIZE -= nbytes; |
1056 |
|
GPT += nchars; |
1057 |
|
ZV += nchars; |
1058 |
|
Z += nchars; |
1059 |
|
GPT_BYTE += nbytes; |
1060 |
|
ZV_BYTE += nbytes; |
1061 |
|
Z_BYTE += nbytes; |
1062 |
|
if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ |
1063 |
|
|
1064 |
|
if (GPT_BYTE < GPT) |
1065 |
|
abort (); |
1066 |
|
|
1067 |
|
adjust_overlays_for_insert (PT, nchars); |
1068 |
|
adjust_markers_for_insert (PT, PT_BYTE, |
1069 |
|
PT + nchars, PT_BYTE + nbytes, |
1070 |
|
0); |
1071 |
|
|
1072 |
|
if (BUF_INTERVALS (current_buffer) != 0) |
1073 |
|
offset_intervals (current_buffer, PT, nchars); |
1074 |
|
|
1075 |
|
adjust_point (nchars, nbytes); |
1076 |
|
|
1077 |
CHECK_MARKERS (); |
CHECK_MARKERS (); |
1078 |
} |
} |
1079 |
|
|