comparison src/xfaces.c @ 5084:863e092a5891

(compute_char_face): Accept new arg LIMIT. Pass Fnext_single_property_change its new arg LIMIT.
author Richard M. Stallman <rms@gnu.org>
date Sat, 20 Nov 1993 09:43:41 +0000
parents 1fc792473491
children af397aaa8e6b
comparison
equal deleted inserted replaced
5083:37fecb3bf8d9 5084:863e092a5891
722 Store into *ENDPTR the position at which a different face is needed. 722 Store into *ENDPTR the position at which a different face is needed.
723 This does not take account of glyphs that specify their own face codes. 723 This does not take account of glyphs that specify their own face codes.
724 F is the frame in use for display, and W is a window displaying 724 F is the frame in use for display, and W is a window displaying
725 the current buffer. 725 the current buffer.
726 726
727 REGION_BEG, REGION_END delimit the region, so it can be highlighted. */ 727 REGION_BEG, REGION_END delimit the region, so it can be highlighted.
728
729 LIMIT is a position not to scan beyond. That is to limit
730 the time this function can take. */
728 731
729 int 732 int
730 compute_char_face (f, w, pos, region_beg, region_end, endptr) 733 compute_char_face (f, w, pos, region_beg, region_end, endptr, limit)
731 struct frame *f; 734 struct frame *f;
732 struct window *w; 735 struct window *w;
733 int pos; 736 int pos;
734 int region_beg, region_end; 737 int region_beg, region_end;
735 int *endptr; 738 int *endptr;
739 int limit;
736 { 740 {
737 struct face face; 741 struct face face;
738 Lisp_Object prop, position; 742 Lisp_Object prop, position;
739 int i, j, noverlays; 743 int i, j, noverlays;
740 int facecode; 744 int facecode;
755 endpos = region_beg; 759 endpos = region_beg;
756 760
757 XFASTINT (position) = pos; 761 XFASTINT (position) = pos;
758 prop = Fget_text_property (position, Qface, w->buffer); 762 prop = Fget_text_property (position, Qface, w->buffer);
759 { 763 {
760 Lisp_Object end; 764 Lisp_Object limit1, end;
761 765
762 end = Fnext_single_property_change (position, Qface, w->buffer); 766 XFASTINT (limit1) = (limit < endpos ? limit : endpos);
767 end = Fnext_single_property_change (position, Qface, w->buffer, limit1);
763 if (INTEGERP (end)) 768 if (INTEGERP (end))
764 endpos = XINT (end); 769 endpos = XINT (end);
765 } 770 }
766 771
767 { 772 {