]> git.eshelyaron.com Git - emacs.git/commitdiff
Include "character.h" instead of "charset.h".
authorKenichi Handa <handa@m17n.org>
Fri, 1 Mar 2002 01:42:42 +0000 (01:42 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 1 Mar 2002 01:42:42 +0000 (01:42 +0000)
(copy_text): Don't refer to Vnonascii_translation_table.
(insert_from_gap): New function.

src/insdel.c

index 365819b2cfff0534ea98400f479acb5eba91f76e..91d111d2fe02ae10c8162600e956062713fe0772 100644 (file)
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA.  */
 #include "lisp.h"
 #include "intervals.h"
 #include "buffer.h"
-#include "charset.h"
+#include "character.h"
 #include "window.h"
 #include "blockinput.h"
 #include "region-cache.h"
@@ -670,17 +670,6 @@ copy_text (from_addr, to_addr, nbytes,
       int bytes_left = nbytes;
       Lisp_Object tbl = Qnil;
 
-      /* 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.  */
       while (bytes_left > 0)
        {
          int thislen, c;
@@ -1048,6 +1037,46 @@ insert_1_both (string, nchars, nbytes, inherit, prepare, before_markers)
   CHECK_MARKERS ();
 }
 \f
+/* Insert a sequence of NCHARS chars which occupy NBYTES bytes
+   starting at GPT_ADDR.  This funciton assumes PT == GPT.  */
+
+void
+insert_from_gap (nchars, nbytes)
+     register int nchars, nbytes;
+{
+  if (PT != GPT)
+    abort ();
+
+  if (NILP (current_buffer->enable_multibyte_characters))
+    nchars = nbytes;
+
+  MODIFF++;
+
+  GAP_SIZE -= nbytes;
+  GPT += nchars;
+  ZV += nchars;
+  Z += nchars;
+  GPT_BYTE += nbytes;
+  ZV_BYTE += nbytes;
+  Z_BYTE += nbytes;
+  if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor.  */
+
+  if (GPT_BYTE < GPT)
+    abort ();
+
+  adjust_overlays_for_insert (PT, nchars);
+  adjust_markers_for_insert (PT, PT_BYTE,
+                            PT + nchars, PT_BYTE + nbytes,
+                            0);
+
+  if (BUF_INTERVALS (current_buffer) != 0)
+    offset_intervals (current_buffer, PT, nchars);
+
+  adjust_point (nchars, nbytes);
+
+  CHECK_MARKERS ();
+}
+\f
 /* Insert the part of the text of STRING, a Lisp object assumed to be
    of type string, consisting of the LENGTH characters (LENGTH_BYTE bytes)
    starting at position POS / POS_BYTE.  If the text of STRING has properties,