comparison src/xdisp.c @ 91235:4f6b5b90d755

(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.
author Kenichi Handa <handa@m17n.org>
date Fri, 14 Dec 2007 11:15:43 +0000
parents e2f99a24f1e6
children ed2b4d6be27c
comparison
equal deleted inserted replaced
91234:f6cea89c3bfe 91235:4f6b5b90d755
4552 enum prop_handled handled = HANDLED_NORMALLY; 4552 enum prop_handled handled = HANDLED_NORMALLY;
4553 4553
4554 if (FUNCTIONP (Vauto_composition_function)) 4554 if (FUNCTIONP (Vauto_composition_function))
4555 { 4555 {
4556 Lisp_Object val = Qnil; 4556 Lisp_Object val = Qnil;
4557 EMACS_INT pos, pos_byte; 4557 EMACS_INT pos;
4558 int c;
4559 4558
4560 if (STRINGP (it->string)) 4559 if (STRINGP (it->string))
4561 { 4560 pos = IT_STRING_CHARPOS (*it);
4562 const unsigned char *s;
4563
4564 pos = IT_STRING_CHARPOS (*it);
4565 pos_byte = IT_STRING_BYTEPOS (*it);
4566 s = SDATA (it->string) + pos_byte;
4567 if (STRING_MULTIBYTE (it->string))
4568 c = STRING_CHAR (s, 0);
4569 else
4570 c = *s;
4571 }
4572 else 4561 else
4573 { 4562 pos = IT_CHARPOS (*it);
4574 pos = IT_CHARPOS (*it);
4575 pos_byte = IT_BYTEPOS (*it);
4576 c = FETCH_CHAR (pos_byte);
4577 }
4578 4563
4579 val = Fget_text_property (make_number (pos), Qauto_composed, it->string); 4564 val = Fget_text_property (make_number (pos), Qauto_composed, it->string);
4580 if (! NILP (val)) 4565 if (! NILP (val))
4581 { 4566 {
4582 Lisp_Object cmp_prop; 4567 Lisp_Object cmp_prop;
4591 { 4576 {
4592 Lisp_Object gstring = COMPOSITION_COMPONENTS (cmp_prop); 4577 Lisp_Object gstring = COMPOSITION_COMPONENTS (cmp_prop);
4593 Lisp_Object font_object = LGSTRING_FONT (gstring); 4578 Lisp_Object font_object = LGSTRING_FONT (gstring);
4594 4579
4595 if (! EQ (font_object, 4580 if (! EQ (font_object,
4596 font_at (c, pos, FACE_FROM_ID (it->f, it->face_id), 4581 font_at (-1, pos, FACE_FROM_ID (it->f, it->face_id),
4597 it->w, it->string))) 4582 it->w, it->string)))
4598 /* We must re-compute the composition for the 4583 /* We must re-compute the composition for the
4599 different font. */ 4584 different font. */
4600 val = Qnil; 4585 val = Qnil;
4601 } 4586 }
4615 Qauto_composed, 4600 Qauto_composed,
4616 it->string, 4601 it->string,
4617 make_number (limit)); 4602 make_number (limit));
4618 4603
4619 if (XINT (end) < limit) 4604 if (XINT (end) < limit)
4620 { 4605 /* The current point is auto-composed, but there exist
4621 /* The current point is auto-composed, but there 4606 characters not yet composed beyond the
4622 exist characters not yet composed beyond the 4607 auto-composed region. There's a possiblity that
4623 auto-composed region. There's a possiblity that 4608 the last characters in the region may be newly
4624 the last characters in the region may be newly 4609 composed. */
4625 composed. */ 4610 val = Qnil;
4626 if (pos < XINT (end) - 1)
4627 {
4628 if (get_property_and_range (XINT (end) - 1, Qcomposition,
4629 &cmp_prop, &cmp_start,
4630 &cmp_end, it->string))
4631 pos = cmp_start;
4632 else
4633 pos = XINT (end) - 1;
4634 }
4635 val = Qnil;
4636 }
4637 } 4611 }
4638 } 4612 }
4639 if (NILP (val)) 4613 if (NILP (val))
4640 { 4614 {
4641 int count = SPECPDL_INDEX (); 4615 int count = SPECPDL_INDEX ();