diff options
| author | Kenichi Handa | 2003-12-02 04:40:49 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-12-02 04:40:49 +0000 |
| commit | c0c99152f409c8528885a4c91624c37019770fd6 (patch) | |
| tree | 33128feeba8d94c3729430f66d18ff9ac9648670 /src | |
| parent | 9541b9ed1a0a39ca7e1746dfc7c9daef10b893d3 (diff) | |
| download | emacs-c0c99152f409c8528885a4c91624c37019770fd6.tar.gz emacs-c0c99152f409c8528885a4c91624c37019770fd6.zip | |
(handle_auto_composed_prop): Give limit to
Fnext_single_char_property_change.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index bc8ed03868c..8a5e101c370 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3788,14 +3788,18 @@ handle_auto_composed_prop (it) | |||
| 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; |
| @@ -3828,11 +3832,16 @@ handle_auto_composed_prop (it) | |||
| 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 | } |