From ce021083cdd62fd15e44b38a28dac560679c070c Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 14 Dec 2007 11:15:43 +0000 Subject: [PATCH] (handle_auto_composed_prop): Don't get a character at the position here, and call font_at with the arg C -1. Don't check the range of the existing composition at the point. --- src/xdisp.c | 46 ++++++++++------------------------------------ 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 41c39a2f62b..973f8f705cd 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4554,27 +4554,12 @@ handle_auto_composed_prop (it) if (FUNCTIONP (Vauto_composition_function)) { Lisp_Object val = Qnil; - EMACS_INT pos, pos_byte; - int c; + EMACS_INT pos; if (STRINGP (it->string)) - { - const unsigned char *s; - - pos = IT_STRING_CHARPOS (*it); - pos_byte = IT_STRING_BYTEPOS (*it); - s = SDATA (it->string) + pos_byte; - if (STRING_MULTIBYTE (it->string)) - c = STRING_CHAR (s, 0); - else - c = *s; - } + pos = IT_STRING_CHARPOS (*it); else - { - pos = IT_CHARPOS (*it); - pos_byte = IT_BYTEPOS (*it); - c = FETCH_CHAR (pos_byte); - } + pos = IT_CHARPOS (*it); val = Fget_text_property (make_number (pos), Qauto_composed, it->string); if (! NILP (val)) @@ -4593,7 +4578,7 @@ handle_auto_composed_prop (it) Lisp_Object font_object = LGSTRING_FONT (gstring); if (! EQ (font_object, - font_at (c, pos, FACE_FROM_ID (it->f, it->face_id), + font_at (-1, pos, FACE_FROM_ID (it->f, it->face_id), it->w, it->string))) /* We must re-compute the composition for the different font. */ @@ -4617,23 +4602,12 @@ handle_auto_composed_prop (it) make_number (limit)); if (XINT (end) < limit) - { - /* The current point is auto-composed, but there - exist characters not yet composed beyond the - auto-composed region. There's a possiblity that - the last characters in the region may be newly - composed. */ - if (pos < XINT (end) - 1) - { - if (get_property_and_range (XINT (end) - 1, Qcomposition, - &cmp_prop, &cmp_start, - &cmp_end, it->string)) - pos = cmp_start; - else - pos = XINT (end) - 1; - } - val = Qnil; - } + /* The current point is auto-composed, but there exist + characters not yet composed beyond the + auto-composed region. There's a possiblity that + the last characters in the region may be newly + composed. */ + val = Qnil; } } if (NILP (val)) -- 2.39.5