Function: char-syntax

char-syntax is a function defined in syntax.c.

Signature

(char-syntax CHARACTER)

Documentation

Return the syntax code of CHARACTER, described by a character.

For example, if CHARACTER is a word constituent, the character w (119) is returned. The characters that correspond to various syntax codes are listed in the documentation of modify-syntax-entry.

If you're trying to determine the syntax of characters in the buffer, this is probably the wrong function to use, because it can't take syntax-table text properties into account. Consider using syntax-after instead.

Probably introduced at or before Emacs version 17.

Source Code

// Defined in /usr/src/emacs/src/syntax.c
{
  int char_int;
  CHECK_CHARACTER (character);
  char_int = XFIXNUM (character);
  SETUP_BUFFER_SYNTAX_TABLE ();
  return make_fixnum (syntax_code_spec[SYNTAX (char_int)]);
}