diff options
| author | Stefan Monnier | 2010-09-30 01:28:20 +0200 |
|---|---|---|
| committer | Stefan Monnier | 2010-09-30 01:28:20 +0200 |
| commit | a01a7932080e8a6e7bc8472c58cefabcc2c37df3 (patch) | |
| tree | 94b28b19c8f1536e76ffe7d5826811b74a79e3a5 /src/composite.c | |
| parent | cc390e46c7ba95b76ea133d98fd386214cd01709 (diff) | |
| parent | 6b0f7311f16646e0de2045b2410e20921901c616 (diff) | |
| download | emacs-a01a7932080e8a6e7bc8472c58cefabcc2c37df3.tar.gz emacs-a01a7932080e8a6e7bc8472c58cefabcc2c37df3.zip | |
Merge from trunk
Diffstat (limited to 'src/composite.c')
| -rw-r--r-- | src/composite.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/composite.c b/src/composite.c index bc5a67ef6e2..be9aafbeacc 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -180,7 +180,8 @@ Lisp_Object composition_temp; | |||
| 180 | If the composition is invalid, return -1. */ | 180 | If the composition is invalid, return -1. */ |
| 181 | 181 | ||
| 182 | int | 182 | int |
| 183 | get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp_Object string) | 183 | get_composition_id (EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT nchars, |
| 184 | Lisp_Object prop, Lisp_Object string) | ||
| 184 | { | 185 | { |
| 185 | Lisp_Object id, length, components, key, *key_contents; | 186 | Lisp_Object id, length, components, key, *key_contents; |
| 186 | int glyph_len; | 187 | int glyph_len; |
| @@ -188,7 +189,8 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp | |||
| 188 | int hash_index; | 189 | int hash_index; |
| 189 | unsigned hash_code; | 190 | unsigned hash_code; |
| 190 | struct composition *cmp; | 191 | struct composition *cmp; |
| 191 | int i, ch; | 192 | EMACS_INT i; |
| 193 | int ch; | ||
| 192 | 194 | ||
| 193 | /* PROP should be | 195 | /* PROP should be |
| 194 | Form-A: ((LENGTH . COMPONENTS) . MODIFICATION-FUNC) | 196 | Form-A: ((LENGTH . COMPONENTS) . MODIFICATION-FUNC) |
| @@ -290,7 +292,7 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp | |||
| 290 | && VECTORP (AREF (components, 0))) | 292 | && VECTORP (AREF (components, 0))) |
| 291 | { | 293 | { |
| 292 | /* COMPONENTS is a glyph-string. */ | 294 | /* COMPONENTS is a glyph-string. */ |
| 293 | int len = ASIZE (key); | 295 | EMACS_UINT len = ASIZE (key); |
| 294 | 296 | ||
| 295 | for (i = 1; i < len; i++) | 297 | for (i = 1; i < len; i++) |
| 296 | if (! VECTORP (AREF (key, i))) | 298 | if (! VECTORP (AREF (key, i))) |
| @@ -298,7 +300,7 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp | |||
| 298 | } | 300 | } |
| 299 | else if (VECTORP (components) || CONSP (components)) | 301 | else if (VECTORP (components) || CONSP (components)) |
| 300 | { | 302 | { |
| 301 | int len = XVECTOR (key)->size; | 303 | EMACS_UINT len = XVECTOR (key)->size; |
| 302 | 304 | ||
| 303 | /* The number of elements should be odd. */ | 305 | /* The number of elements should be odd. */ |
| 304 | if ((len % 2) == 0) | 306 | if ((len % 2) == 0) |
| @@ -427,7 +429,9 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp | |||
| 427 | This doesn't check the validity of composition. */ | 429 | This doesn't check the validity of composition. */ |
| 428 | 430 | ||
| 429 | int | 431 | int |
| 430 | find_composition (int pos, int limit, EMACS_INT *start, EMACS_INT *end, Lisp_Object *prop, Lisp_Object object) | 432 | find_composition (EMACS_INT pos, EMACS_INT limit, |
| 433 | EMACS_INT *start, EMACS_INT *end, | ||
| 434 | Lisp_Object *prop, Lisp_Object object) | ||
| 431 | { | 435 | { |
| 432 | Lisp_Object val; | 436 | Lisp_Object val; |
| 433 | 437 | ||
| @@ -465,7 +469,7 @@ find_composition (int pos, int limit, EMACS_INT *start, EMACS_INT *end, Lisp_Obj | |||
| 465 | FROM and TO with property PROP. */ | 469 | FROM and TO with property PROP. */ |
| 466 | 470 | ||
| 467 | static void | 471 | static void |
| 468 | run_composition_function (int from, int to, Lisp_Object prop) | 472 | run_composition_function (EMACS_INT from, EMACS_INT to, Lisp_Object prop) |
| 469 | { | 473 | { |
| 470 | Lisp_Object func; | 474 | Lisp_Object func; |
| 471 | EMACS_INT start, end; | 475 | EMACS_INT start, end; |
| @@ -628,7 +632,8 @@ make_composition_value_copy (Lisp_Object list) | |||
| 628 | indices START and END in STRING. */ | 632 | indices START and END in STRING. */ |
| 629 | 633 | ||
| 630 | void | 634 | void |
| 631 | compose_text (int start, int end, Lisp_Object components, Lisp_Object modification_func, Lisp_Object string) | 635 | compose_text (EMACS_INT start, EMACS_INT end, Lisp_Object components, |
| 636 | Lisp_Object modification_func, Lisp_Object string) | ||
| 632 | { | 637 | { |
| 633 | Lisp_Object prop; | 638 | Lisp_Object prop; |
| 634 | 639 | ||
| @@ -735,7 +740,8 @@ composition_gstring_p (Lisp_Object gstring) | |||
| 735 | } | 740 | } |
| 736 | 741 | ||
| 737 | int | 742 | int |
| 738 | composition_gstring_width (Lisp_Object gstring, int from, int to, struct font_metrics *metrics) | 743 | composition_gstring_width (Lisp_Object gstring, EMACS_INT from, EMACS_INT to, |
| 744 | struct font_metrics *metrics) | ||
| 739 | { | 745 | { |
| 740 | Lisp_Object *glyph; | 746 | Lisp_Object *glyph; |
| 741 | int width = 0; | 747 | int width = 0; |
| @@ -907,7 +913,7 @@ autocmp_chars (Lisp_Object rule, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT | |||
| 907 | EMACS_INT to; | 913 | EMACS_INT to; |
| 908 | EMACS_INT pt = PT, pt_byte = PT_BYTE; | 914 | EMACS_INT pt = PT, pt_byte = PT_BYTE; |
| 909 | Lisp_Object re, font_object, lgstring; | 915 | Lisp_Object re, font_object, lgstring; |
| 910 | int len; | 916 | EMACS_INT len; |
| 911 | 917 | ||
| 912 | record_unwind_save_match_data (); | 918 | record_unwind_save_match_data (); |
| 913 | re = AREF (rule, 0); | 919 | re = AREF (rule, 0); |
| @@ -1397,7 +1403,7 @@ composition_update_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_I | |||
| 1397 | /* automatic composition */ | 1403 | /* automatic composition */ |
| 1398 | Lisp_Object gstring = composition_gstring_from_id (cmp_it->id); | 1404 | Lisp_Object gstring = composition_gstring_from_id (cmp_it->id); |
| 1399 | Lisp_Object glyph; | 1405 | Lisp_Object glyph; |
| 1400 | int from, to; | 1406 | EMACS_INT from; |
| 1401 | 1407 | ||
| 1402 | if (cmp_it->nglyphs == 0) | 1408 | if (cmp_it->nglyphs == 0) |
| 1403 | { | 1409 | { |
| @@ -1656,7 +1662,7 @@ find_automatic_composition (EMACS_INT pos, EMACS_INT limit, EMACS_INT *start, EM | |||
| 1656 | /* Return the adjusted point provided that point is moved from LAST_PT | 1662 | /* Return the adjusted point provided that point is moved from LAST_PT |
| 1657 | to NEW_PT. */ | 1663 | to NEW_PT. */ |
| 1658 | 1664 | ||
| 1659 | int | 1665 | EMACS_INT |
| 1660 | composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt) | 1666 | composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt) |
| 1661 | { | 1667 | { |
| 1662 | EMACS_INT charpos, bytepos, startpos, beg, end, pos; | 1668 | EMACS_INT charpos, bytepos, startpos, beg, end, pos; |
| @@ -1879,9 +1885,9 @@ See `find-composition' for more details. */) | |||
| 1879 | id = COMPOSITION_ID (prop); | 1885 | id = COMPOSITION_ID (prop); |
| 1880 | else | 1886 | else |
| 1881 | { | 1887 | { |
| 1882 | int start_byte = (NILP (string) | 1888 | EMACS_INT start_byte = (NILP (string) |
| 1883 | ? CHAR_TO_BYTE (start) | 1889 | ? CHAR_TO_BYTE (start) |
| 1884 | : string_char_to_byte (string, start)); | 1890 | : string_char_to_byte (string, start)); |
| 1885 | id = get_composition_id (start, start_byte, end - start, prop, string); | 1891 | id = get_composition_id (start, start_byte, end - start, prop, string); |
| 1886 | } | 1892 | } |
| 1887 | 1893 | ||