emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/insdel.c,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/insdel.c,v
Date: Fri, 01 Feb 2008 16:02:09 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     08/02/01 16:01:31

Index: src/insdel.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/insdel.c,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -b -r1.196 -r1.197
--- src/insdel.c        8 Jan 2008 20:44:22 -0000       1.196
+++ src/insdel.c        1 Feb 2008 16:00:48 -0000       1.197
@@ -25,7 +25,7 @@
 #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"
@@ -653,22 +653,11 @@
       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;
          c = STRING_CHAR_AND_LENGTH (from_addr, bytes_left, thislen);
-         if (!SINGLE_BYTE_CHAR_P (c))
+         if (!ASCII_CHAR_P (c))
            c = multibyte_char_to_unibyte (c, tbl);
          *to_addr++ = c;
          from_addr += thislen;
@@ -1174,6 +1163,50 @@
                               current_buffer, inherit);
 
   adjust_point (nchars, outgoing_nbytes);
+
+  CHECK_MARKERS ();
+}
+
+/* Insert a sequence of NCHARS chars which occupy NBYTES bytes
+   starting at GPT_ADDR.  */
+
+void
+insert_from_gap (nchars, nbytes)
+     register int nchars, nbytes;
+{
+  if (NILP (current_buffer->enable_multibyte_characters))
+    nchars = nbytes;
+
+  record_insert (GPT, nchars);
+  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 (GPT - nchars, nchars);
+  adjust_markers_for_insert (GPT - nchars, GPT_BYTE - nbytes,
+                            GPT, GPT_BYTE, 0);
+
+  if (BUF_INTERVALS (current_buffer) != 0)
+    {
+      offset_intervals (current_buffer, GPT - nchars, nchars);
+      graft_intervals_into_buffer (NULL_INTERVAL, GPT - nchars, nchars,
+                                  current_buffer, 0);
+    }
+
+  if (GPT - nchars < PT)
+    adjust_point (nchars, nbytes);
+
+  CHECK_MARKERS ();
 }
 
 /* Insert text from BUF, NCHARS characters starting at CHARPOS, into the




reply via email to

[Prev in Thread] Current Thread [Next in Thread]