Show
Ignore:
Timestamp:
05/18/06 16:19:18 (3 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/textprop.c

    r4073 r4085  
    718718it finds a change in some text property, or the beginning or end of an 
    719719overlay, and returns the position of that. 
    720 If none is found, the function returns (point-max). 
     720If none is found up to (point-max), the function returns (point-max). 
    721721 
    722722If the optional second argument LIMIT is non-nil, don't search 
    723 past position LIMIT; return LIMIT if nothing is found before LIMIT.  */) 
     723past position LIMIT; return LIMIT if nothing is found before LIMIT. 
     724LIMIT is a no-op if it is greater than (point-max).  */) 
    724725     (position, limit) 
    725726     Lisp_Object position, limit; 
     
    743744finds a change in some text property, or the beginning or end of an 
    744745overlay, and returns the position of that. 
    745 If none is found, the function returns (point-max). 
     746If none is found since (point-min), the function returns (point-min). 
    746747 
    747748If the optional second argument LIMIT is non-nil, don't search 
    748 past position LIMIT; return LIMIT if nothing is found before LIMIT.  */) 
     749past position LIMIT; return LIMIT if nothing is found before LIMIT. 
     750LIMIT is a no-op if it is less than (point-min).  */) 
    749751     (position, limit) 
    750752     Lisp_Object position, limit; 
     
    772774If OBJECT is a string, POSITION is a 0-based index into it. 
    773775 
     776In a string, scan runs to the end of the string. 
     777In a buffer, it runs to (point-max), and the value cannot exceed that. 
     778 
    774779The property values are compared with `eq'. 
    775780If the property is constant all the way to the end of OBJECT, return the 
     
    813818 
    814819      if (NILP (limit)) 
    815         XSETFASTINT (limit, BUF_ZV (current_buffer)); 
     820        XSETFASTINT (limit, ZV); 
    816821      else 
    817822        CHECK_NUMBER_COERCE_MARKER (limit); 
    818823 
    819       for (;;) 
    820         { 
    821           position = Fnext_char_property_change (position, limit); 
    822           if (XFASTINT (position) >= XFASTINT (limit)) { 
    823             position = limit; 
    824             break; 
     824      if (XFASTINT (position) >= XFASTINT (limit)) 
     825        { 
     826          position = limit; 
     827          if (XFASTINT (position) > ZV) 
     828            XSETFASTINT (position, ZV); 
     829        } 
     830      else 
     831        while (1) 
     832          { 
     833            position = Fnext_char_property_change (position, limit); 
     834            if (XFASTINT (position) >= XFASTINT (limit)) 
     835              { 
     836                position = limit; 
     837                break; 
     838              } 
     839 
     840            value = Fget_char_property (position, prop, object); 
     841            if (!EQ (value, initial_value)) 
     842              break; 
    825843          } 
    826  
    827           value = Fget_char_property (position, prop, object); 
    828           if (!EQ (value, initial_value)) 
    829             break; 
    830         } 
    831844 
    832845      unbind_to (count, Qnil); 
     
    846859If OBJECT is a string, POSITION is a 0-based index into it. 
    847860 
     861In a string, scan runs to the start of the string. 
     862In a buffer, it runs to (point-min), and the value cannot be less than that. 
     863 
    848864The property values are compared with `eq'. 
    849865If the property is constant all the way to the start of OBJECT, return the 
     
    884900 
    885901      if (NILP (limit)) 
    886         XSETFASTINT (limit, BUF_BEGV (current_buffer)); 
     902        XSETFASTINT (limit, BEGV); 
    887903      else 
    888904        CHECK_NUMBER_COERCE_MARKER (limit); 
    889905 
    890906      if (XFASTINT (position) <= XFASTINT (limit)) 
    891         position = limit; 
     907        { 
     908          position = limit; 
     909          if (XFASTINT (position) < BEGV) 
     910            XSETFASTINT (position, BEGV); 
     911        } 
    892912      else 
    893913        { 
    894           Lisp_Object initial_value = 
    895             Fget_char_property (make_number (XFASTINT (position) - 1), 
    896                                 prop, object); 
    897  
    898           for (;;
     914          Lisp_Object initial_value 
     915            = Fget_char_property (make_number (XFASTINT (position) - 1), 
     916                                  prop, object); 
     917 
     918          while (1
    899919            { 
    900920              position = Fprevious_char_property_change (position, limit); 
     
    907927              else 
    908928                { 
    909                   Lisp_Object value = 
    910                     Fget_char_property (make_number (XFASTINT (position) - 1), 
    911                                         prop, object); 
     929                  Lisp_Object value 
     930                    = Fget_char_property (make_number (XFASTINT (position) - 1), 
     931                                          prop, object); 
    912932 
    913933                  if (!EQ (value, initial_value))