/[emacs]/emacs/src/region-cache.c
ViewVC logotype

Diff of /emacs/src/region-cache.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by monnier, Tue Apr 16 12:39:25 2002 UTC revision 1.4.2.1 by miles, Fri Apr 4 06:21:03 2003 UTC
# Line 131  static void revalidate_region_cache (); Line 131  static void revalidate_region_cache ();
131  struct region_cache *  struct region_cache *
132  new_region_cache ()  new_region_cache ()
133  {  {
134    struct region_cache *c    struct region_cache *c
135      = (struct region_cache *) xmalloc (sizeof (struct region_cache));      = (struct region_cache *) xmalloc (sizeof (struct region_cache));
136    
137    c->gap_start = 0;    c->gap_start = 0;
# Line 385  delete_cache_boundaries (c, start, end) Line 385  delete_cache_boundaries (c, start, end)
385    
386    c->cache_len -= len;    c->cache_len -= len;
387  }  }
388        
389    
390    
391  /* Set the value for a region.  */  /* Set the value for a region.  */
# Line 407  set_cache_region (c, start, end, value) Line 407  set_cache_region (c, start, end, value)
407       both the locations of real characters in the buffer.  */       both the locations of real characters in the buffer.  */
408    if (start == end)    if (start == end)
409      return;      return;
410      
411    {    {
412      /* We need to make sure that there are no boundaries in the area      /* We need to make sure that there are no boundaries in the area
413         between start to end; the whole area will have the same value,         between start to end; the whole area will have the same value,
414         so those boundaries will not be necessary.         so those boundaries will not be necessary.
415          
416         Let start_ix be the cache index of the boundary governing the         Let start_ix be the cache index of the boundary governing the
417         first character of start..end, and let end_ix be the cache         first character of start..end, and let end_ix be the cache
418         index of the earliest boundary after the last character in         index of the earliest boundary after the last character in
# Line 456  set_cache_region (c, start, end, value) Line 456  set_cache_region (c, start, end, value)
456              start_ix++;              start_ix++;
457            }            }
458        }        }
459              
460      /* This is equivalent to letting end_ix float (like a buffer      /* This is equivalent to letting end_ix float (like a buffer
461         marker does) with the insertions and deletions we may have         marker does) with the insertions and deletions we may have
462         done.  */         done.  */
# Line 553  invalidate_region_cache (buf, c, head, t Line 553  invalidate_region_cache (buf, c, head, t
553  }  }
554    
555    
556  /* Clean out any cache entries applying to the modified region, and  /* Clean out any cache entries applying to the modified region, and
557     make the positions of the remaining entries accurate again.     make the positions of the remaining entries accurate again.
558    
559     After calling this function, the mess described in the comment in     After calling this function, the mess described in the comment in
# Line 606  revalidate_region_cache (buf, c) Line 606  revalidate_region_cache (buf, c)
606       (which will give the modified region the same size in the cache       (which will give the modified region the same size in the cache
607       as it has in the buffer), and then invalidate the modified       as it has in the buffer), and then invalidate the modified
608       region. */       region. */
609    if (c->buffer_beg + c->beg_unchanged    if (c->buffer_beg + c->beg_unchanged
610        == c->buffer_end - c->end_unchanged)        == c->buffer_end - c->end_unchanged)
611      {      {
612        /* Move the gap so that all the boundaries in the unchanged head        /* Move the gap so that all the boundaries in the unchanged head
# Line 721  know_region_cache (buf, c, start, end) Line 721  know_region_cache (buf, c, start, end)
721  /* Interface: using the cache.  */  /* Interface: using the cache.  */
722    
723  /* Return true if the text immediately after POS in BUF is known, for  /* Return true if the text immediately after POS in BUF is known, for
724     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
725     position after POS where the knownness changes.  */     position after POS where the knownness changes.  */
726  int  int
727  region_cache_forward (buf, c, pos, next)  region_cache_forward (buf, c, pos, next)

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.4.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26