comparison src/textprop.c @ 13265:dbc038e66ea6

(Fnext_single_property_change): Rearrange handling of limit = t; don't return t.
author Richard M. Stallman <rms@gnu.org>
date Sat, 21 Oct 1995 23:15:21 +0000
parents 48358e0fa98e
children dc00b7be6593
comparison
equal deleted inserted replaced
13264:4e7bb697c847 13265:dbc038e66ea6
622 622
623 if (! NILP (limit) && ! EQ (limit, Qt)) 623 if (! NILP (limit) && ! EQ (limit, Qt))
624 CHECK_NUMBER_COERCE_MARKER (limit, 0); 624 CHECK_NUMBER_COERCE_MARKER (limit, 0);
625 625
626 i = validate_interval_range (object, &pos, &pos, soft); 626 i = validate_interval_range (object, &pos, &pos, soft);
627 if (NULL_INTERVAL_P (i)) 627
628 return limit;
629
630 next = next_interval (i);
631 /* If LIMIT is t, return start of next interval--don't 628 /* If LIMIT is t, return start of next interval--don't
632 bother checking further intervals. */ 629 bother checking further intervals. */
633 if (EQ (limit, Qt)) 630 if (EQ (limit, Qt))
634 { 631 {
632 if (NULL_INTERVAL_P (i))
633 next = i;
634 else
635 next = next_interval (i);
636
635 if (NULL_INTERVAL_P (next)) 637 if (NULL_INTERVAL_P (next))
636 XSETFASTINT (pos, (STRINGP (object) 638 XSETFASTINT (pos, (STRINGP (object)
637 ? XSTRING (object)->size 639 ? XSTRING (object)->size
638 : BUF_ZV (XBUFFER (object)))); 640 : BUF_ZV (XBUFFER (object))));
639 else 641 else
640 XSETFASTINT (pos, next->position - (STRINGP (object))); 642 XSETFASTINT (pos, next->position - (STRINGP (object)));
641 return pos; 643 return pos;
642 } 644 }
645
646 if (NULL_INTERVAL_P (i))
647 return limit;
648
649 next = next_interval (i);
643 650
644 while (! NULL_INTERVAL_P (next) && intervals_equal (i, next) 651 while (! NULL_INTERVAL_P (next) && intervals_equal (i, next)
645 && (NILP (limit) || next->position < XFASTINT (limit))) 652 && (NILP (limit) || next->position < XFASTINT (limit)))
646 next = next_interval (next); 653 next = next_interval (next);
647 654