Function: char-width

char-width is a function defined in character.c.

Signature

(char-width CHAR)

Documentation

Return width of CHAR when displayed in the current buffer.

The width is measured by how many columns it occupies on the screen. Tab is taken to occupy tab-width columns.

Probably introduced at or before Emacs version 20.1.

Source Code

// Defined in /usr/src/emacs/src/character.c
{
  int c;
  ptrdiff_t width;

  CHECK_CHARACTER (ch);
  c = XFIXNUM (ch);
  width = char_width (c, buffer_display_table ());
  return make_fixnum (width);
}