Update years in copyright notice; nfc.
[bpt/emacs.git] / src / region-cache.c
index b852e2a..d49278e 100644 (file)
@@ -1,6 +1,6 @@
 /* Caching facts about regions of the buffer, for optimization.
-   Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993
-       Free Software Foundation, Inc.
+   Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1995, 2002, 2003, 2004,
+                 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -16,16 +16,17 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 
 #include <config.h>
+#include <stdio.h>
+
 #include "lisp.h"
 #include "buffer.h"
 #include "region-cache.h"
 
-#include <stdio.h>
-
 \f
 /* Data structures.  */
 
@@ -130,7 +131,7 @@ static void revalidate_region_cache ();
 struct region_cache *
 new_region_cache ()
 {
-  struct region_cache *c 
+  struct region_cache *c
     = (struct region_cache *) xmalloc (sizeof (struct region_cache));
 
   c->gap_start = 0;
@@ -142,8 +143,8 @@ new_region_cache ()
 
   c->beg_unchanged = 0;
   c->end_unchanged = 0;
-  c->buffer_beg = 1;
-  c->buffer_end = 1;
+  c->buffer_beg = BEG;
+  c->buffer_end = BEG;
 
   /* Insert the boundary for the buffer start.  */
   c->cache_len++;
@@ -384,7 +385,7 @@ delete_cache_boundaries (c, start, end)
 
   c->cache_len -= len;
 }
-     
+
 
 \f
 /* Set the value for a region.  */
@@ -406,12 +407,12 @@ set_cache_region (c, start, end, value)
      both the locations of real characters in the buffer.  */
   if (start == end)
     return;
-  
+
   {
     /* We need to make sure that there are no boundaries in the area
        between start to end; the whole area will have the same value,
        so those boundaries will not be necessary.
-       
+
        Let start_ix be the cache index of the boundary governing the
        first character of start..end, and let end_ix be the cache
        index of the earliest boundary after the last character in
@@ -455,7 +456,7 @@ set_cache_region (c, start, end, value)
             start_ix++;
           }
       }
-          
+
     /* This is equivalent to letting end_ix float (like a buffer
        marker does) with the insertions and deletions we may have
        done.  */
@@ -552,7 +553,7 @@ invalidate_region_cache (buf, c, head, tail)
 }
 
 
-/* Clean out any cache entries applying to the modified region, and 
+/* Clean out any cache entries applying to the modified region, and
    make the positions of the remaining entries accurate again.
 
    After calling this function, the mess described in the comment in
@@ -605,7 +606,7 @@ revalidate_region_cache (buf, c)
      (which will give the modified region the same size in the cache
      as it has in the buffer), and then invalidate the modified
      region. */
-  if (c->buffer_beg + c->beg_unchanged 
+  if (c->buffer_beg + c->beg_unchanged
       == c->buffer_end - c->end_unchanged)
     {
       /* Move the gap so that all the boundaries in the unchanged head
@@ -720,7 +721,7 @@ know_region_cache (buf, c, start, end)
 /* Interface: using the cache.  */
 
 /* Return true if the text immediately after POS in BUF is known, for
-   the purposes of CACHE.  If NEXT is non-zero, set *NEXT to the nearest 
+   the purposes of CACHE.  If NEXT is non-zero, set *NEXT to the nearest
    position after POS where the knownness changes.  */
 int
 region_cache_forward (buf, c, pos, next)
@@ -831,3 +832,6 @@ pp_cache (c)
       fprintf (stderr, "%d : %d\n", pos, BOUNDARY_VALUE (c, i));
     }
 }
+
+/* arch-tag: 98c29f3f-2ca2-4e3a-92f0-f2249200a17d
+   (do not change this comment) */