Function: make-char-table

make-char-table is a function defined in chartab.c.

Signature

(make-char-table PURPOSE &optional INIT)

Documentation

Return a newly created char-table, with purpose PURPOSE.

Each element is initialized to INIT, which defaults to nil.

PURPOSE should be a symbol. If it has a char-table-extra-slots property, the property's value should be an integer between 0 and 10 that specifies how many extra slots the char-table has. Otherwise, the char-table has no extra slot.

View in manual

Probably introduced at or before Emacs version 19.30.

Source Code

// Defined in /usr/src/emacs/src/chartab.c
{
  Lisp_Object vector;
  Lisp_Object n;
  int n_extras;
  int size;

  CHECK_SYMBOL (purpose);
  n = Fget (purpose, Qchar_table_extra_slots);
  if (NILP (n))
    n_extras = 0;
  else
    {
      CHECK_FIXNAT (n);
      n_extras = XFIXNUM (n);
    }

  size = CHAR_TABLE_STANDARD_SLOTS + n_extras;
  vector = make_vector (size, init);
  XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE);
  set_char_table_parent (vector, Qnil);
  set_char_table_purpose (vector, purpose);
  XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
  return vector;
}