diff options
| author | Kenichi Handa | 2007-12-14 11:15:43 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2007-12-14 11:15:43 +0000 |
| commit | ce021083cdd62fd15e44b38a28dac560679c070c (patch) | |
| tree | 334719faf5b04b54e9eb816fa769af693f8fe6c5 /src | |
| parent | f8e341abb3ee2595b7c69c4c5a15f3f4404fdee1 (diff) | |
| download | emacs-ce021083cdd62fd15e44b38a28dac560679c070c.tar.gz emacs-ce021083cdd62fd15e44b38a28dac560679c070c.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 46 |
1 files 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) | |||
| 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)) |
| @@ -4593,7 +4578,7 @@ handle_auto_composed_prop (it) | |||
| 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. */ |
| @@ -4617,23 +4602,12 @@ handle_auto_composed_prop (it) | |||
| 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)) |