diff options
| author | Kenichi Handa | 2002-11-07 06:24:40 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2002-11-07 06:24:40 +0000 |
| commit | df013a7fa50eb0f19f52d4426a09563c833c7f39 (patch) | |
| tree | 60d69d159d71178d68b118a625be69206dcff15e /src | |
| parent | b7c2af7f65f40899c2bd978cedd50f61e099cfbf (diff) | |
| download | emacs-df013a7fa50eb0f19f52d4426a09563c833c7f39.tar.gz emacs-df013a7fa50eb0f19f52d4426a09563c833c7f39.zip | |
(it_props): Add an entry for Qauto_composed.
(handle_auto_composed_prop): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 84a407ed074..9a934ba2311 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -637,11 +637,13 @@ static enum prop_handled handle_display_prop P_ ((struct it *)); | |||
| 637 | static enum prop_handled handle_composition_prop P_ ((struct it *)); | 637 | static enum prop_handled handle_composition_prop P_ ((struct it *)); |
| 638 | static enum prop_handled handle_overlay_change P_ ((struct it *)); | 638 | static enum prop_handled handle_overlay_change P_ ((struct it *)); |
| 639 | static enum prop_handled handle_fontified_prop P_ ((struct it *)); | 639 | static enum prop_handled handle_fontified_prop P_ ((struct it *)); |
| 640 | static enum prop_handled handle_auto_composed_prop P_ ((struct it *)); | ||
| 640 | 641 | ||
| 641 | /* Properties handled by iterators. */ | 642 | /* Properties handled by iterators. */ |
| 642 | 643 | ||
| 643 | static struct props it_props[] = | 644 | static struct props it_props[] = |
| 644 | { | 645 | { |
| 646 | {&Qauto_composed, AUTO_COMPOSED_PROP_IDX, handle_auto_composed_prop}, | ||
| 645 | {&Qfontified, FONTIFIED_PROP_IDX, handle_fontified_prop}, | 647 | {&Qfontified, FONTIFIED_PROP_IDX, handle_fontified_prop}, |
| 646 | /* Handle `face' before `display' because some sub-properties of | 648 | /* Handle `face' before `display' because some sub-properties of |
| 647 | `display' need to know the face. */ | 649 | `display' need to know the face. */ |
| @@ -3285,6 +3287,44 @@ string_buffer_position (w, string, around_charpos) | |||
| 3285 | `composition' property | 3287 | `composition' property |
| 3286 | ***********************************************************************/ | 3288 | ***********************************************************************/ |
| 3287 | 3289 | ||
| 3290 | static enum prop_handled | ||
| 3291 | handle_auto_composed_prop (it) | ||
| 3292 | struct it *it; | ||
| 3293 | { | ||
| 3294 | enum prop_handled handled = HANDLED_NORMALLY; | ||
| 3295 | |||
| 3296 | if (! NILP (Vauto_composition_function)) | ||
| 3297 | { | ||
| 3298 | Lisp_Object val; | ||
| 3299 | int pos; | ||
| 3300 | |||
| 3301 | if (STRINGP (it->string)) | ||
| 3302 | pos = IT_STRING_CHARPOS (*it); | ||
| 3303 | else | ||
| 3304 | pos = IT_CHARPOS (*it); | ||
| 3305 | |||
| 3306 | val =Fget_char_property (make_number (pos), Qauto_composed, it->string); | ||
| 3307 | if (NILP (val)) | ||
| 3308 | { | ||
| 3309 | int count = BINDING_STACK_SIZE (); | ||
| 3310 | Lisp_Object args[3]; | ||
| 3311 | |||
| 3312 | args[0] = Vauto_composition_function; | ||
| 3313 | specbind (Qauto_composition_function, Qnil); | ||
| 3314 | args[1] = make_number (pos); | ||
| 3315 | args[2] = it->string; | ||
| 3316 | safe_call (3, args); | ||
| 3317 | unbind_to (count, Qnil); | ||
| 3318 | |||
| 3319 | val = Fget_char_property (args[1], Qauto_composed, it->string); | ||
| 3320 | if (! NILP (val)) | ||
| 3321 | handled = HANDLED_RECOMPUTE_PROPS; | ||
| 3322 | } | ||
| 3323 | } | ||
| 3324 | |||
| 3325 | return handled; | ||
| 3326 | } | ||
| 3327 | |||
| 3288 | /* Set up iterator IT from `composition' property at its current | 3328 | /* Set up iterator IT from `composition' property at its current |
| 3289 | position. Called from handle_stop. */ | 3329 | position. Called from handle_stop. */ |
| 3290 | 3330 | ||