diff options
| author | Dmitry Antipov | 2013-08-03 22:16:43 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-08-03 22:16:43 +0400 |
| commit | 75c59fb3ec3188d4c7c20675b7beaa07cb0c1891 (patch) | |
| tree | dace6552f5541628f3ffd52031bf143889fadc2b /src/composite.c | |
| parent | 5e471f0dbc0f9b42646a3689552723902b990f76 (diff) | |
| download | emacs-75c59fb3ec3188d4c7c20675b7beaa07cb0c1891.tar.gz emacs-75c59fb3ec3188d4c7c20675b7beaa07cb0c1891.zip | |
Do not use global Lisp_Object in composition macros.
* composite.h (composition_temp): Remove declaration.
(COMPOSITION_METHOD, COMPOSITION_VALID_P): Replace with...
(composition_method, composition_valid_p): ...inline functions.
* composite.c (composition_temp): Remove.
(run_composition_function, update_compositions)
(composition_compute_stop_pos, composition_adjust_point)
(Ffind_composition_internal):
* coding.c (handle_composition_annotation):
* xdisp.c (handle_composition_prop, check_point_in_composition):
Related users changed.
Diffstat (limited to 'src/composite.c')
| -rw-r--r-- | src/composite.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/composite.c b/src/composite.c index 5dbddba78bb..91a5c75630a 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -160,10 +160,6 @@ static Lisp_Object Qauto_composition_function; | |||
| 160 | auto-compositions. */ | 160 | auto-compositions. */ |
| 161 | #define MAX_AUTO_COMPOSITION_LOOKBACK 3 | 161 | #define MAX_AUTO_COMPOSITION_LOOKBACK 3 |
| 162 | 162 | ||
| 163 | /* Temporary variable used in macros COMPOSITION_XXX. */ | ||
| 164 | Lisp_Object composition_temp; | ||
| 165 | |||
| 166 | |||
| 167 | /* Return COMPOSITION-ID of a composition at buffer position | 163 | /* Return COMPOSITION-ID of a composition at buffer position |
| 168 | CHARPOS/BYTEPOS and length NCHARS. The `composition' property of | 164 | CHARPOS/BYTEPOS and length NCHARS. The `composition' property of |
| 169 | the sequence is PROP. STRING, if non-nil, is a string that | 165 | the sequence is PROP. STRING, if non-nil, is a string that |
| @@ -478,11 +474,11 @@ run_composition_function (ptrdiff_t from, ptrdiff_t to, Lisp_Object prop) | |||
| 478 | valid too. */ | 474 | valid too. */ |
| 479 | if (from > BEGV | 475 | if (from > BEGV |
| 480 | && find_composition (from - 1, -1, &start, &end, &prop, Qnil) | 476 | && find_composition (from - 1, -1, &start, &end, &prop, Qnil) |
| 481 | && !COMPOSITION_VALID_P (start, end, prop)) | 477 | && !composition_valid_p (start, end, prop)) |
| 482 | from = start; | 478 | from = start; |
| 483 | if (to < ZV | 479 | if (to < ZV |
| 484 | && find_composition (to, -1, &start, &end, &prop, Qnil) | 480 | && find_composition (to, -1, &start, &end, &prop, Qnil) |
| 485 | && !COMPOSITION_VALID_P (start, end, prop)) | 481 | && !composition_valid_p (start, end, prop)) |
| 486 | to = end; | 482 | to = end; |
| 487 | if (!NILP (Ffboundp (func))) | 483 | if (!NILP (Ffboundp (func))) |
| 488 | call2 (func, make_number (from), make_number (to)); | 484 | call2 (func, make_number (from), make_number (to)); |
| @@ -524,7 +520,7 @@ update_compositions (ptrdiff_t from, ptrdiff_t to, int check_mask) | |||
| 524 | latter to the copy of it. */ | 520 | latter to the copy of it. */ |
| 525 | if (from > BEGV | 521 | if (from > BEGV |
| 526 | && find_composition (from - 1, -1, &start, &end, &prop, Qnil) | 522 | && find_composition (from - 1, -1, &start, &end, &prop, Qnil) |
| 527 | && COMPOSITION_VALID_P (start, end, prop)) | 523 | && composition_valid_p (start, end, prop)) |
| 528 | { | 524 | { |
| 529 | min_pos = start; | 525 | min_pos = start; |
| 530 | if (end > to) | 526 | if (end > to) |
| @@ -538,7 +534,7 @@ update_compositions (ptrdiff_t from, ptrdiff_t to, int check_mask) | |||
| 538 | } | 534 | } |
| 539 | else if (from < ZV | 535 | else if (from < ZV |
| 540 | && find_composition (from, -1, &start, &from, &prop, Qnil) | 536 | && find_composition (from, -1, &start, &from, &prop, Qnil) |
| 541 | && COMPOSITION_VALID_P (start, from, prop)) | 537 | && composition_valid_p (start, from, prop)) |
| 542 | { | 538 | { |
| 543 | if (from > to) | 539 | if (from > to) |
| 544 | max_pos = from; | 540 | max_pos = from; |
| @@ -553,7 +549,7 @@ update_compositions (ptrdiff_t from, ptrdiff_t to, int check_mask) | |||
| 553 | (to - 1). */ | 549 | (to - 1). */ |
| 554 | while (from < to - 1 | 550 | while (from < to - 1 |
| 555 | && find_composition (from, to, &start, &from, &prop, Qnil) | 551 | && find_composition (from, to, &start, &from, &prop, Qnil) |
| 556 | && COMPOSITION_VALID_P (start, from, prop) | 552 | && composition_valid_p (start, from, prop) |
| 557 | && from < to - 1) | 553 | && from < to - 1) |
| 558 | run_composition_function (start, from, prop); | 554 | run_composition_function (start, from, prop); |
| 559 | } | 555 | } |
| @@ -562,7 +558,7 @@ update_compositions (ptrdiff_t from, ptrdiff_t to, int check_mask) | |||
| 562 | { | 558 | { |
| 563 | if (from < to | 559 | if (from < to |
| 564 | && find_composition (to - 1, -1, &start, &end, &prop, Qnil) | 560 | && find_composition (to - 1, -1, &start, &end, &prop, Qnil) |
| 565 | && COMPOSITION_VALID_P (start, end, prop)) | 561 | && composition_valid_p (start, end, prop)) |
| 566 | { | 562 | { |
| 567 | /* TO should be also at composition boundary. But, | 563 | /* TO should be also at composition boundary. But, |
| 568 | insertion or deletion will make two compositions adjacent | 564 | insertion or deletion will make two compositions adjacent |
| @@ -580,7 +576,7 @@ update_compositions (ptrdiff_t from, ptrdiff_t to, int check_mask) | |||
| 580 | } | 576 | } |
| 581 | else if (to < ZV | 577 | else if (to < ZV |
| 582 | && find_composition (to, -1, &start, &end, &prop, Qnil) | 578 | && find_composition (to, -1, &start, &end, &prop, Qnil) |
| 583 | && COMPOSITION_VALID_P (start, end, prop)) | 579 | && composition_valid_p (start, end, prop)) |
| 584 | { | 580 | { |
| 585 | run_composition_function (start, end, prop); | 581 | run_composition_function (start, end, prop); |
| 586 | max_pos = end; | 582 | max_pos = end; |
| @@ -1012,7 +1008,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos, | |||
| 1012 | if (charpos < endpos | 1008 | if (charpos < endpos |
| 1013 | && find_composition (charpos, endpos, &start, &end, &prop, string) | 1009 | && find_composition (charpos, endpos, &start, &end, &prop, string) |
| 1014 | && start >= charpos | 1010 | && start >= charpos |
| 1015 | && COMPOSITION_VALID_P (start, end, prop)) | 1011 | && composition_valid_p (start, end, prop)) |
| 1016 | { | 1012 | { |
| 1017 | cmp_it->stop_pos = endpos = start; | 1013 | cmp_it->stop_pos = endpos = start; |
| 1018 | cmp_it->ch = -1; | 1014 | cmp_it->ch = -1; |
| @@ -1672,7 +1668,7 @@ composition_adjust_point (ptrdiff_t last_pt, ptrdiff_t new_pt) | |||
| 1672 | 1668 | ||
| 1673 | /* At first check the static composition. */ | 1669 | /* At first check the static composition. */ |
| 1674 | if (get_property_and_range (new_pt, Qcomposition, &val, &beg, &end, Qnil) | 1670 | if (get_property_and_range (new_pt, Qcomposition, &val, &beg, &end, Qnil) |
| 1675 | && COMPOSITION_VALID_P (beg, end, val)) | 1671 | && composition_valid_p (beg, end, val)) |
| 1676 | { | 1672 | { |
| 1677 | if (beg < new_pt /* && end > new_pt <- It's always the case. */ | 1673 | if (beg < new_pt /* && end > new_pt <- It's always the case. */ |
| 1678 | && (last_pt <= beg || last_pt >= end)) | 1674 | && (last_pt <= beg || last_pt >= end)) |
| @@ -1872,7 +1868,7 @@ See `find-composition' for more details. */) | |||
| 1872 | && (e <= XINT (pos) ? e > end : s < start)) | 1868 | && (e <= XINT (pos) ? e > end : s < start)) |
| 1873 | return list3 (make_number (s), make_number (e), gstring); | 1869 | return list3 (make_number (s), make_number (e), gstring); |
| 1874 | } | 1870 | } |
| 1875 | if (!COMPOSITION_VALID_P (start, end, prop)) | 1871 | if (!composition_valid_p (start, end, prop)) |
| 1876 | return list3 (make_number (start), make_number (end), Qnil); | 1872 | return list3 (make_number (start), make_number (end), Qnil); |
| 1877 | if (NILP (detail_p)) | 1873 | if (NILP (detail_p)) |
| 1878 | return list3 (make_number (start), make_number (end), Qt); | 1874 | return list3 (make_number (start), make_number (end), Qt); |
| @@ -1890,7 +1886,7 @@ See `find-composition' for more details. */) | |||
| 1890 | if (id >= 0) | 1886 | if (id >= 0) |
| 1891 | { | 1887 | { |
| 1892 | Lisp_Object components, relative_p, mod_func; | 1888 | Lisp_Object components, relative_p, mod_func; |
| 1893 | enum composition_method method = COMPOSITION_METHOD (prop); | 1889 | enum composition_method method = composition_method (prop); |
| 1894 | int width = composition_table[id]->width; | 1890 | int width = composition_table[id]->width; |
| 1895 | 1891 | ||
| 1896 | components = Fcopy_sequence (COMPOSITION_COMPONENTS (prop)); | 1892 | components = Fcopy_sequence (COMPOSITION_COMPONENTS (prop)); |