update.
[chise/xemacs-chise.git.1] / src / line-number.c
index a0ad5e1..e9a18dc 100644 (file)
@@ -52,7 +52,6 @@ Boston, MA 02111-1307, USA.  */
 #include <config.h>
 #include "lisp.h"
 #include "buffer.h"
 #include <config.h>
 #include "lisp.h"
 #include "buffer.h"
-#include "insdel.h"
 
 #include "line-number.h"
 
 
 #include "line-number.h"
 
@@ -74,14 +73,14 @@ Boston, MA 02111-1307, USA.  */
 #define LINE_NUMBER_LARGE_STRING 256
 
 /* To be used only when you *know* the cache has been allocated!  */
 #define LINE_NUMBER_LARGE_STRING 256
 
 /* To be used only when you *know* the cache has been allocated!  */
-#define LINE_NUMBER_RING(b) (XCAR ((b)->line_number_cache))
-#define LINE_NUMBER_BEGV(b) (XCDR ((b)->line_number_cache))
+#define LINE_NUMBER_RING(b) (XCAR ((b)->text->line_number_cache))
+#define LINE_NUMBER_BEGV(b) (XCDR ((b)->text->line_number_cache))
 
 
 /* Initialize the cache.  Cache is (in pseudo-BNF):
 
    CACHE               = nil | INITIALIZED-CACHE
 
 
 /* Initialize the cache.  Cache is (in pseudo-BNF):
 
    CACHE               = nil | INITIALIZED-CACHE
-   INITITIALIZED-CACHE = cons (RING, BEGV-LINE)
+   INITIALIZED-CACHE   = cons (RING, BEGV-LINE)
    RING                        = vector (*RING-ELEMENT)
    RING-ELEMENT                = nil | RING-PAIR
    RING-PAIR           = cons (marker, integer)
    RING                        = vector (*RING-ELEMENT)
    RING-ELEMENT                = nil | RING-PAIR
    RING-PAIR           = cons (marker, integer)
@@ -89,21 +88,21 @@ Boston, MA 02111-1307, USA.  */
 
    Line number cache should never, ever, be visible to Lisp (because
    destructively modifying its elements can cause crashes.)  Debug it
 
    Line number cache should never, ever, be visible to Lisp (because
    destructively modifying its elements can cause crashes.)  Debug it
-   using debug_print (current_buffer->last_number_cache).  */
+   using debug_print (current_buffer->text->last_number_cache).  */
 static void
 allocate_line_number_cache (struct buffer *b)
 {
 static void
 allocate_line_number_cache (struct buffer *b)
 {
-  b->line_number_cache = Fcons (make_vector (LINE_NUMBER_RING_SIZE, Qnil),
-                               Qzero);
+  b->text->line_number_cache = Fcons (make_vector (LINE_NUMBER_RING_SIZE, Qnil),
+                                     Qzero);
   narrow_line_number_cache (b);
 }
 
 /* Flag LINE_NUMBER_BEGV (b) as dirty.  Do it only if the line number
   narrow_line_number_cache (b);
 }
 
 /* Flag LINE_NUMBER_BEGV (b) as dirty.  Do it only if the line number
-   cache is already initialized.  */ 
+   cache is already initialized.  */
 void
 narrow_line_number_cache (struct buffer *b)
 {
 void
 narrow_line_number_cache (struct buffer *b)
 {
-  if (NILP (b->line_number_cache))
+  if (NILP (b->text->line_number_cache))
     return;
 
   if (BUF_BEG (b) == BUF_BEGV (b))
     return;
 
   if (BUF_BEG (b) == BUF_BEGV (b))
@@ -159,9 +158,9 @@ invalidate_line_number_cache (struct buffer *b, Bufpos pos)
    This will do nothing if the cache is uninitialized.  */
 void
 insert_invalidate_line_number_cache (struct buffer *b, Bufpos pos,
    This will do nothing if the cache is uninitialized.  */
 void
 insert_invalidate_line_number_cache (struct buffer *b, Bufpos pos,
-                                    CONST Bufbyte *nonreloc, Bytecount length)
+                                    const Bufbyte *nonreloc, Bytecount length)
 {
 {
-  if (NILP (b->line_number_cache))
+  if (NILP (b->text->line_number_cache))
     return;
 
   if (length > LINE_NUMBER_LARGE_STRING
     return;
 
   if (length > LINE_NUMBER_LARGE_STRING
@@ -182,7 +181,7 @@ insert_invalidate_line_number_cache (struct buffer *b, Bufpos pos,
 void
 delete_invalidate_line_number_cache (struct buffer *b, Bufpos from, Bufpos to)
 {
 void
 delete_invalidate_line_number_cache (struct buffer *b, Bufpos from, Bufpos to)
 {
-  if (NILP (b->line_number_cache))
+  if (NILP (b->text->line_number_cache))
     return;
 
   if ((to - from) > LINE_NUMBER_LARGE_STRING)
     return;
 
   if ((to - from) > LINE_NUMBER_LARGE_STRING)
@@ -280,7 +279,7 @@ buffer_line_number (struct buffer *b, Bufpos pos, int cachep)
 
   if (cachep)
     {
 
   if (cachep)
     {
-      if (NILP (b->line_number_cache))
+      if (NILP (b->text->line_number_cache))
        allocate_line_number_cache (b);
       /* If we don't know the line number of BUF_BEGV, calculate it now.  */
       if (XINT (LINE_NUMBER_BEGV (b)) == -1)
        allocate_line_number_cache (b);
       /* If we don't know the line number of BUF_BEGV, calculate it now.  */
       if (XINT (LINE_NUMBER_BEGV (b)) == -1)