diff options
| author | Joakim Verona | 2013-07-02 22:46:17 +0200 |
|---|---|---|
| committer | Joakim Verona | 2013-07-02 22:46:17 +0200 |
| commit | 3718127221fbbc31f8ebd027ab7c95403dbe9118 (patch) | |
| tree | ef422898f3344c8f94f6ecf63eb583122bbf2bd8 /src/chartab.c | |
| parent | 1ce45b902c67b8a0dda8d71bd2812de29a9988a6 (diff) | |
| parent | a3b49114c186d84404226af75ae7905bd1cd018f (diff) | |
| download | emacs-3718127221fbbc31f8ebd027ab7c95403dbe9118.tar.gz emacs-3718127221fbbc31f8ebd027ab7c95403dbe9118.zip | |
Merge branch 'trunk' into xwidget
Conflicts:
src/window.c
Diffstat (limited to 'src/chartab.c')
| -rw-r--r-- | src/chartab.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/chartab.c b/src/chartab.c index 7430235b4af..b7b9590a538 100644 --- a/src/chartab.c +++ b/src/chartab.c | |||
| @@ -84,6 +84,22 @@ static uniprop_decoder_t uniprop_get_decoder (Lisp_Object); | |||
| 84 | (STRINGP (OBJ) && SCHARS (OBJ) > 0 \ | 84 | (STRINGP (OBJ) && SCHARS (OBJ) > 0 \ |
| 85 | && ((SREF (OBJ, 0) == 1 || (SREF (OBJ, 0) == 2)))) | 85 | && ((SREF (OBJ, 0) == 1 || (SREF (OBJ, 0) == 2)))) |
| 86 | 86 | ||
| 87 | static void | ||
| 88 | CHECK_CHAR_TABLE (Lisp_Object x) | ||
| 89 | { | ||
| 90 | CHECK_TYPE (CHAR_TABLE_P (x), Qchar_table_p, x); | ||
| 91 | } | ||
| 92 | |||
| 93 | static void | ||
| 94 | set_char_table_ascii (Lisp_Object table, Lisp_Object val) | ||
| 95 | { | ||
| 96 | XCHAR_TABLE (table)->ascii = val; | ||
| 97 | } | ||
| 98 | static void | ||
| 99 | set_char_table_parent (Lisp_Object table, Lisp_Object val) | ||
| 100 | { | ||
| 101 | XCHAR_TABLE (table)->parent = val; | ||
| 102 | } | ||
| 87 | 103 | ||
| 88 | DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0, | 104 | DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0, |
| 89 | doc: /* Return a newly created char-table, with purpose PURPOSE. | 105 | doc: /* Return a newly created char-table, with purpose PURPOSE. |
| @@ -112,7 +128,7 @@ the char-table has no extra slot. */) | |||
| 112 | n_extras = XINT (n); | 128 | n_extras = XINT (n); |
| 113 | } | 129 | } |
| 114 | 130 | ||
| 115 | size = VECSIZE (struct Lisp_Char_Table) - 1 + n_extras; | 131 | size = CHAR_TABLE_STANDARD_SLOTS + n_extras; |
| 116 | vector = Fmake_vector (make_number (size), init); | 132 | vector = Fmake_vector (make_number (size), init); |
| 117 | XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE); | 133 | XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE); |
| 118 | set_char_table_parent (vector, Qnil); | 134 | set_char_table_parent (vector, Qnil); |
| @@ -125,7 +141,7 @@ static Lisp_Object | |||
| 125 | make_sub_char_table (int depth, int min_char, Lisp_Object defalt) | 141 | make_sub_char_table (int depth, int min_char, Lisp_Object defalt) |
| 126 | { | 142 | { |
| 127 | Lisp_Object table; | 143 | Lisp_Object table; |
| 128 | int size = VECSIZE (struct Lisp_Sub_Char_Table) - 1 + chartab_size[depth]; | 144 | int size = CHAR_TABLE_STANDARD_SLOTS + chartab_size[depth]; |
| 129 | 145 | ||
| 130 | table = Fmake_vector (make_number (size), defalt); | 146 | table = Fmake_vector (make_number (size), defalt); |
| 131 | XSETPVECTYPE (XVECTOR (table), PVEC_SUB_CHAR_TABLE); | 147 | XSETPVECTYPE (XVECTOR (table), PVEC_SUB_CHAR_TABLE); |
| @@ -191,7 +207,7 @@ copy_char_table (Lisp_Object table) | |||
| 191 | ? copy_sub_char_table (XCHAR_TABLE (table)->contents[i]) | 207 | ? copy_sub_char_table (XCHAR_TABLE (table)->contents[i]) |
| 192 | : XCHAR_TABLE (table)->contents[i])); | 208 | : XCHAR_TABLE (table)->contents[i])); |
| 193 | set_char_table_ascii (copy, char_table_ascii (copy)); | 209 | set_char_table_ascii (copy, char_table_ascii (copy)); |
| 194 | size -= VECSIZE (struct Lisp_Char_Table) - 1; | 210 | size -= CHAR_TABLE_STANDARD_SLOTS; |
| 195 | for (i = 0; i < size; i++) | 211 | for (i = 0; i < size; i++) |
| 196 | set_char_table_extras (copy, i, XCHAR_TABLE (table)->extras[i]); | 212 | set_char_table_extras (copy, i, XCHAR_TABLE (table)->extras[i]); |
| 197 | 213 | ||