Go to the previous, next section.
In addition to the classes, entries for characters in a syntax table can include flags. There are six possible flags, represented by the characters `1', `2', `3', `4', `b' and `p'.
All the flags except `p' are used to describe multi-character comment delimiters. The digit flags indicate that a character can also be part of a comment sequence, in addition to the syntactic properties associated with its character class. The flags are independent of the class and each other for the sake of characters such as `*' in C mode, which is a punctuation character, and the second character of a start-of-comment sequence (`/*'), and the first character of an end-of-comment sequence (`*/').
The flags for a character c are:
Emacs can now supports two comment styles simultaneously. (This is for the sake of C++.) More specifically, it can recognize two different comment-start sequences. Both must share the same first character; only the second character may differ. Mark the second character of the "b"-style comment start sequence with the `b' flag.
The two styles of comment can have different comment-end sequences. A comment-end sequence (one or two characters) applies to the "b" style if its first character has the `b' flag set; otherwise, it applies to the "a" style.
The appropriate comment syntax settings for C++ are as follows:
Thus `/*' is a comment-start sequence for "a" style, `//' is a comment-start sequence for "b" style, `*/' is a comment-end sequence for "a" style, and newline is a comment-end sequence for "b" style.
The function backward-prefix-chars moves back over these
characters, as well as over characters whose primary syntax class is
prefix (`'').
Go to the previous, next section.