diff options
| author | Kenichi Handa | 2002-07-26 04:05:29 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2002-07-26 04:05:29 +0000 |
| commit | eaa3b0e07ace0fb5c494f8f88f7e377983f4faca (patch) | |
| tree | 9429879dc99ff25298918ca25a9eda4e2952cb1d /src/chartab.c | |
| parent | 093ff45304d112743a5199cc9085379d0c0f9647 (diff) | |
| download | emacs-eaa3b0e07ace0fb5c494f8f88f7e377983f4faca.tar.gz emacs-eaa3b0e07ace0fb5c494f8f88f7e377983f4faca.zip | |
(Fmake_char_table): Doc fixed. If PURPOSE doesn't
have property char-table-extra-slots, make no extra slot.
Diffstat (limited to 'src/chartab.c')
| -rw-r--r-- | src/chartab.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/chartab.c b/src/chartab.c index 54ffc8055e0..3f9a9b8e00c 100644 --- a/src/chartab.c +++ b/src/chartab.c | |||
| @@ -56,32 +56,31 @@ const int chartab_bits[4] = | |||
| 56 | 56 | ||
| 57 | 57 | ||
| 58 | DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0, | 58 | DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0, |
| 59 | doc: /* Return a newly created char-table. | 59 | doc: /* Return a newly created char-table, with purpose PURPOSE. |
| 60 | Each element is initialized to INIT, which defaults to nil. | 60 | Each element is initialized to INIT, which defaults to nil. |
| 61 | 61 | ||
| 62 | Optional second argument PURPOSE, if non-nil, should be a symbol | 62 | PURPOSE should be a symbol. If it has a `char-table-extra-slots' |
| 63 | which has a `char-table-extra-slots' property. | 63 | property, the property's value should be an integer between 0 and 10 |
| 64 | The property's value should be an integer between 0 and 10 | 64 | that specifies how many extra slots the char-table has. Otherwise, |
| 65 | that specify how many extra slots the char-table has. | 65 | the char-table has no extra slot. */) |
| 66 | By default, the char-table has no extra slot. */) | ||
| 67 | (purpose, init) | 66 | (purpose, init) |
| 68 | register Lisp_Object purpose, init; | 67 | register Lisp_Object purpose, init; |
| 69 | { | 68 | { |
| 70 | Lisp_Object vector; | 69 | Lisp_Object vector; |
| 71 | Lisp_Object n; | 70 | Lisp_Object n; |
| 72 | int n_extras = 0; | 71 | int n_extras; |
| 73 | int size; | 72 | int size; |
| 74 | 73 | ||
| 75 | CHECK_SYMBOL (purpose); | 74 | CHECK_SYMBOL (purpose); |
| 76 | if (! NILP (purpose)) | 75 | n = Fget (purpose, Qchar_table_extra_slots); |
| 76 | if (NILP (n)) | ||
| 77 | n_extras = 0; | ||
| 78 | else | ||
| 77 | { | 79 | { |
| 78 | n = Fget (purpose, Qchar_table_extra_slots); | 80 | CHECK_NATNUM (n); |
| 79 | if (INTEGERP (n)) | 81 | n_extras = XINT (n); |
| 80 | { | 82 | if (n_extras > 10) |
| 81 | if (XINT (n) < 0 || XINT (n) > 10) | 83 | args_out_of_range (n, Qnil); |
| 82 | args_out_of_range (n, Qnil); | ||
| 83 | n_extras = XINT (n); | ||
| 84 | } | ||
| 85 | } | 84 | } |
| 86 | 85 | ||
| 87 | size = VECSIZE (struct Lisp_Char_Table) - 1 + n_extras; | 86 | size = VECSIZE (struct Lisp_Char_Table) - 1 + n_extras; |