Mercurial > emacs
comparison src/xdisp.c @ 89673:d563d35e3d58
(handle_auto_composed_prop): Give limit to
Fnext_single_char_property_change.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 02 Dec 2003 04:40:49 +0000 |
parents | 6b2fe2bf684e |
children | af1655b4ee65 |
comparison
equal
deleted
inserted
replaced
89672:3b65414d605d | 89673:d563d35e3d58 |
---|---|
3786 this_pos = pos; | 3786 this_pos = pos; |
3787 | 3787 |
3788 val =Fget_char_property (make_number (pos), Qauto_composed, it->string); | 3788 val =Fget_char_property (make_number (pos), Qauto_composed, it->string); |
3789 if (! NILP (val)) | 3789 if (! NILP (val)) |
3790 { | 3790 { |
3791 Lisp_Object next; | 3791 Lisp_Object limit = Qnil, next; |
3792 | 3792 |
3793 /* As Fnext_single_char_property_change is very slow, we | |
3794 limit the search to the current line. */ | |
3795 if (! STRINGP (it->string)) | |
3796 limit = make_number (find_next_newline_no_quit (pos, 1)); | |
3793 next = (Fnext_single_property_change | 3797 next = (Fnext_single_property_change |
3794 (make_number (pos), Qauto_composed, it->string, Qnil)); | 3798 (make_number (pos), Qauto_composed, it->string, limit)); |
3795 if (INTEGERP (next)) | 3799 if (XINT (next) < XINT (limit)) |
3796 { | 3800 { |
3797 /* The current point is auto-composed, but there exist | 3801 /* The current point is auto-composed, but there exist |
3798 characers not yet composed beyond the auto-compused | 3802 characters not yet composed beyond the auto-composed |
3799 region. There's a possiblity that the last | 3803 region. There's a possiblity that the last |
3800 characters in the region may be newly composed. */ | 3804 characters in the region may be newly composed. */ |
3801 int charpos = XINT (next) - 1, bytepos, c; | 3805 int charpos = XINT (next) - 1, bytepos, c; |
3802 | 3806 |
3803 if (STRINGP (it->string)) | 3807 if (STRINGP (it->string)) |
3826 args[1] = make_number (pos); | 3830 args[1] = make_number (pos); |
3827 args[2] = it->string; | 3831 args[2] = it->string; |
3828 safe_call (3, args); | 3832 safe_call (3, args); |
3829 unbind_to (count, Qnil); | 3833 unbind_to (count, Qnil); |
3830 | 3834 |
3831 val = Fget_char_property (args[1], Qauto_composed, it->string); | 3835 if (this_pos == pos) |
3832 /* Return HANDLED_RECOMPUTE_PROPS only if function fontified | 3836 { |
3833 something. This avoids an endless loop if they failed to | 3837 val = Fget_char_property (args[1], Qauto_composed, it->string); |
3834 fontify the text for which reason ever. */ | 3838 /* Return HANDLED_RECOMPUTE_PROPS only if function composed |
3835 if (! NILP (val)) | 3839 something. This avoids an endless loop if they failed to |
3840 fontify the text for which reason ever. */ | |
3841 if (! NILP (val)) | |
3842 handled = HANDLED_RECOMPUTE_PROPS; | |
3843 } | |
3844 else | |
3836 handled = HANDLED_RECOMPUTE_PROPS; | 3845 handled = HANDLED_RECOMPUTE_PROPS; |
3837 } | 3846 } |
3838 } | 3847 } |
3839 | 3848 |
3840 return handled; | 3849 return handled; |