Mercurial > emacs
comparison src/xdisp.c @ 91229:e2f99a24f1e6
(handle_auto_composed_prop): Use Fget_text_property
instead of get_property_and_range.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 13 Dec 2007 01:32:44 +0000 |
parents | 53108e6cea98 |
children | 4f6b5b90d755 |
comparison
equal
deleted
inserted
replaced
91228:9b51a7263aec | 91229:e2f99a24f1e6 |
---|---|
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, this_pos, start, end; | 4557 EMACS_INT pos, pos_byte; |
4558 int c; | 4558 int c; |
4559 | 4559 |
4560 if (STRINGP (it->string)) | 4560 if (STRINGP (it->string)) |
4561 { | 4561 { |
4562 const unsigned char *s; | 4562 const unsigned char *s; |
4573 { | 4573 { |
4574 pos = IT_CHARPOS (*it); | 4574 pos = IT_CHARPOS (*it); |
4575 pos_byte = IT_BYTEPOS (*it); | 4575 pos_byte = IT_BYTEPOS (*it); |
4576 c = FETCH_CHAR (pos_byte); | 4576 c = FETCH_CHAR (pos_byte); |
4577 } | 4577 } |
4578 this_pos = pos; | 4578 |
4579 | 4579 val = Fget_text_property (make_number (pos), Qauto_composed, it->string); |
4580 if (get_property_and_range (pos, Qauto_composed, &val, &start, &end, | 4580 if (! NILP (val)) |
4581 it->string)) | |
4582 { | 4581 { |
4583 Lisp_Object cmp_prop; | 4582 Lisp_Object cmp_prop; |
4584 EMACS_INT cmp_start, cmp_end; | 4583 EMACS_INT cmp_start, cmp_end; |
4585 | 4584 |
4586 #ifdef USE_FONT_BACKEND | 4585 #ifdef USE_FONT_BACKEND |
4601 val = Qnil; | 4600 val = Qnil; |
4602 } | 4601 } |
4603 #endif | 4602 #endif |
4604 if (! NILP (val)) | 4603 if (! NILP (val)) |
4605 { | 4604 { |
4605 Lisp_Object end; | |
4606 EMACS_INT limit; | 4606 EMACS_INT limit; |
4607 | 4607 |
4608 /* As Fnext_single_char_property_change is very slow, we | 4608 /* As Fnext_single_char_property_change is very slow, we |
4609 limit the search to the current line. */ | 4609 limit the search to the current line. */ |
4610 if (STRINGP (it->string)) | 4610 if (STRINGP (it->string)) |
4611 limit = SCHARS (it->string); | 4611 limit = SCHARS (it->string); |
4612 else | 4612 else |
4613 limit = find_next_newline_no_quit (pos, 1); | 4613 limit = find_next_newline_no_quit (pos, 1); |
4614 | 4614 end = Fnext_single_char_property_change (make_number (pos), |
4615 if (end < limit) | 4615 Qauto_composed, |
4616 it->string, | |
4617 make_number (limit)); | |
4618 | |
4619 if (XINT (end) < limit) | |
4616 { | 4620 { |
4617 /* The current point is auto-composed, but there | 4621 /* The current point is auto-composed, but there |
4618 exist characters not yet composed beyond the | 4622 exist characters not yet composed beyond the |
4619 auto-composed region. There's a possiblity that | 4623 auto-composed region. There's a possiblity that |
4620 the last characters in the region may be newly | 4624 the last characters in the region may be newly |
4621 composed. */ | 4625 composed. */ |
4622 if (pos < end - 1) | 4626 if (pos < XINT (end) - 1) |
4623 { | 4627 { |
4624 if (get_property_and_range (end - 1, Qcomposition, | 4628 if (get_property_and_range (XINT (end) - 1, Qcomposition, |
4625 &cmp_prop, &cmp_start, | 4629 &cmp_prop, &cmp_start, |
4626 &cmp_end, it->string)) | 4630 &cmp_end, it->string)) |
4627 pos = cmp_start; | 4631 pos = cmp_start; |
4628 else | 4632 else |
4629 pos = end - 1; | 4633 pos = XINT (end) - 1; |
4630 } | 4634 } |
4631 val = Qnil; | 4635 val = Qnil; |
4632 } | 4636 } |
4633 } | 4637 } |
4634 } | 4638 } |