diff options
Diffstat (limited to 'src/composite.c')
| -rw-r--r-- | src/composite.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/composite.c b/src/composite.c index bcde0a4c9e6..8b1f0171a60 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Composite sequence support. | 1 | /* Composite sequence support. |
| 2 | Copyright (C) 2001-2012 Free Software Foundation, Inc. | 2 | Copyright (C) 2001-2013 Free Software Foundation, Inc. |
| 3 | Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 | 3 | Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 |
| 4 | National Institute of Advanced Industrial Science and Technology (AIST) | 4 | National Institute of Advanced Industrial Science and Technology (AIST) |
| 5 | Registration Number H14PRO021 | 5 | Registration Number H14PRO021 |
| @@ -234,7 +234,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars, | |||
| 234 | key = components; | 234 | key = components; |
| 235 | else if (NILP (components)) | 235 | else if (NILP (components)) |
| 236 | { | 236 | { |
| 237 | key = Fmake_vector (make_number (nchars), Qnil); | 237 | key = make_uninit_vector (nchars); |
| 238 | if (STRINGP (string)) | 238 | if (STRINGP (string)) |
| 239 | for (i = 0; i < nchars; i++) | 239 | for (i = 0; i < nchars; i++) |
| 240 | { | 240 | { |
| @@ -642,13 +642,7 @@ compose_text (ptrdiff_t start, ptrdiff_t end, Lisp_Object components, | |||
| 642 | Qcomposition, prop, string); | 642 | Qcomposition, prop, string); |
| 643 | } | 643 | } |
| 644 | 644 | ||
| 645 | 645 | /* Lisp glyph-string handlers. */ | |
| 646 | static Lisp_Object autocmp_chars (Lisp_Object, ptrdiff_t, ptrdiff_t, | ||
| 647 | ptrdiff_t, struct window *, | ||
| 648 | struct face *, Lisp_Object); | ||
| 649 | |||
| 650 | |||
| 651 | /* Lisp glyph-string handlers */ | ||
| 652 | 646 | ||
| 653 | /* Hash table for automatic composition. The key is a header of a | 647 | /* Hash table for automatic composition. The key is a header of a |
| 654 | lgstring (Lispy glyph-string), and the value is a body of a | 648 | lgstring (Lispy glyph-string), and the value is a body of a |
| @@ -704,10 +698,6 @@ composition_gstring_from_id (ptrdiff_t id) | |||
| 704 | return HASH_VALUE (h, id); | 698 | return HASH_VALUE (h, id); |
| 705 | } | 699 | } |
| 706 | 700 | ||
| 707 | static Lisp_Object fill_gstring_header (Lisp_Object, Lisp_Object, | ||
| 708 | Lisp_Object, Lisp_Object, | ||
| 709 | Lisp_Object); | ||
| 710 | |||
| 711 | bool | 701 | bool |
| 712 | composition_gstring_p (Lisp_Object gstring) | 702 | composition_gstring_p (Lisp_Object gstring) |
| 713 | { | 703 | { |
| @@ -797,7 +787,8 @@ static Lisp_Object gstring_work; | |||
| 797 | static Lisp_Object gstring_work_headers; | 787 | static Lisp_Object gstring_work_headers; |
| 798 | 788 | ||
| 799 | static Lisp_Object | 789 | static Lisp_Object |
| 800 | fill_gstring_header (Lisp_Object header, Lisp_Object start, Lisp_Object end, Lisp_Object font_object, Lisp_Object string) | 790 | fill_gstring_header (Lisp_Object header, Lisp_Object start, Lisp_Object end, |
| 791 | Lisp_Object font_object, Lisp_Object string) | ||
| 801 | { | 792 | { |
| 802 | ptrdiff_t from, to, from_byte; | 793 | ptrdiff_t from, to, from_byte; |
| 803 | ptrdiff_t len, i; | 794 | ptrdiff_t len, i; |
| @@ -837,7 +828,7 @@ fill_gstring_header (Lisp_Object header, Lisp_Object start, Lisp_Object end, Lis | |||
| 837 | if (len <= 8) | 828 | if (len <= 8) |
| 838 | header = AREF (gstring_work_headers, len - 1); | 829 | header = AREF (gstring_work_headers, len - 1); |
| 839 | else | 830 | else |
| 840 | header = Fmake_vector (make_number (len + 1), Qnil); | 831 | header = make_uninit_vector (len + 1); |
| 841 | } | 832 | } |
| 842 | 833 | ||
| 843 | ASET (header, 0, font_object); | 834 | ASET (header, 0, font_object); |
| @@ -905,7 +896,9 @@ fill_gstring_body (Lisp_Object gstring) | |||
| 905 | object. Otherwise return nil. */ | 896 | object. Otherwise return nil. */ |
| 906 | 897 | ||
| 907 | static Lisp_Object | 898 | static Lisp_Object |
| 908 | autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t limit, struct window *win, struct face *face, Lisp_Object string) | 899 | autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, |
| 900 | ptrdiff_t limit, struct window *win, struct face *face, | ||
| 901 | Lisp_Object string) | ||
| 909 | { | 902 | { |
| 910 | ptrdiff_t count = SPECPDL_INDEX (); | 903 | ptrdiff_t count = SPECPDL_INDEX (); |
| 911 | FRAME_PTR f = XFRAME (win->frame); | 904 | FRAME_PTR f = XFRAME (win->frame); |
| @@ -935,7 +928,7 @@ autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t | |||
| 935 | #ifdef HAVE_WINDOW_SYSTEM | 928 | #ifdef HAVE_WINDOW_SYSTEM |
| 936 | if (FRAME_WINDOW_P (f)) | 929 | if (FRAME_WINDOW_P (f)) |
| 937 | { | 930 | { |
| 938 | font_object = font_range (charpos, &to, win, face, string); | 931 | font_object = font_range (charpos, bytepos, &to, win, face, string); |
| 939 | if (! FONT_OBJECT_P (font_object) | 932 | if (! FONT_OBJECT_P (font_object) |
| 940 | || (! NILP (re) | 933 | || (! NILP (re) |
| 941 | && to < limit | 934 | && to < limit |
| @@ -1958,7 +1951,7 @@ syms_of_composite (void) | |||
| 1958 | } | 1951 | } |
| 1959 | 1952 | ||
| 1960 | staticpro (&gstring_work_headers); | 1953 | staticpro (&gstring_work_headers); |
| 1961 | gstring_work_headers = Fmake_vector (make_number (8), Qnil); | 1954 | gstring_work_headers = make_uninit_vector (8); |
| 1962 | for (i = 0; i < 8; i++) | 1955 | for (i = 0; i < 8; i++) |
| 1963 | ASET (gstring_work_headers, i, Fmake_vector (make_number (i + 2), Qnil)); | 1956 | ASET (gstring_work_headers, i, Fmake_vector (make_number (i + 2), Qnil)); |
| 1964 | staticpro (&gstring_work); | 1957 | staticpro (&gstring_work); |