diff options
| author | Kenichi Handa | 2002-03-01 01:42:42 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2002-03-01 01:42:42 +0000 |
| commit | 811f73706a0a9a7b09330cc0183f2e526f072067 (patch) | |
| tree | 0234a236ed59e01e87a94b33019477ad1c44a68a /src | |
| parent | f6ed712f0a15dccac87d306f0c38aeb57e48ea0f (diff) | |
| download | emacs-811f73706a0a9a7b09330cc0183f2e526f072067.tar.gz emacs-811f73706a0a9a7b09330cc0183f2e526f072067.zip | |
Include "character.h" instead of "charset.h".
(copy_text): Don't refer to Vnonascii_translation_table.
(insert_from_gap): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/insdel.c | 53 |
1 files changed, 41 insertions, 12 deletions
diff --git a/src/insdel.c b/src/insdel.c index 365819b2cff..91d111d2fe0 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 24 | #include "lisp.h" | 24 | #include "lisp.h" |
| 25 | #include "intervals.h" | 25 | #include "intervals.h" |
| 26 | #include "buffer.h" | 26 | #include "buffer.h" |
| 27 | #include "charset.h" | 27 | #include "character.h" |
| 28 | #include "window.h" | 28 | #include "window.h" |
| 29 | #include "blockinput.h" | 29 | #include "blockinput.h" |
| 30 | #include "region-cache.h" | 30 | #include "region-cache.h" |
| @@ -670,17 +670,6 @@ copy_text (from_addr, to_addr, nbytes, | |||
| 670 | int bytes_left = nbytes; | 670 | int bytes_left = nbytes; |
| 671 | Lisp_Object tbl = Qnil; | 671 | Lisp_Object tbl = Qnil; |
| 672 | 672 | ||
| 673 | /* We set the variable tbl to the reverse table of | ||
| 674 | Vnonascii_translation_table in advance. */ | ||
| 675 | if (CHAR_TABLE_P (Vnonascii_translation_table)) | ||
| 676 | { | ||
| 677 | tbl = Fchar_table_extra_slot (Vnonascii_translation_table, | ||
| 678 | make_number (0)); | ||
| 679 | if (!CHAR_TABLE_P (tbl)) | ||
| 680 | tbl = Qnil; | ||
| 681 | } | ||
| 682 | |||
| 683 | /* Convert multibyte to single byte. */ | ||
| 684 | while (bytes_left > 0) | 673 | while (bytes_left > 0) |
| 685 | { | 674 | { |
| 686 | int thislen, c; | 675 | int thislen, c; |
| @@ -1048,6 +1037,46 @@ insert_1_both (string, nchars, nbytes, inherit, prepare, before_markers) | |||
| 1048 | CHECK_MARKERS (); | 1037 | CHECK_MARKERS (); |
| 1049 | } | 1038 | } |
| 1050 | 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 (); | ||
| 1078 | } | ||
| 1079 | |||
| 1051 | /* Insert the part of the text of STRING, a Lisp object assumed to be | 1080 | /* Insert the part of the text of STRING, a Lisp object assumed to be |
| 1052 | of type string, consisting of the LENGTH characters (LENGTH_BYTE bytes) | 1081 | of type string, consisting of the LENGTH characters (LENGTH_BYTE bytes) |
| 1053 | starting at position POS / POS_BYTE. If the text of STRING has properties, | 1082 | starting at position POS / POS_BYTE. If the text of STRING has properties, |