GNU Emacs Lisp Reference Manual
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:
1 means c is the start of a two-character comment-start
sequence.
2 means c is the second character of such a sequence.
3 means c is the start of a two-character comment-end
sequence.
4 means c is the second character of such a sequence.
b means that c as a comment delimiter belongs to the
alternative ``b'' comment style.
Emacs supports two comment styles simultaneously in any one syntax table. This is for the sake of C++. Each style of comment syntax has its own comment-start sequence and its own comment-end sequence. Each comment must stick to one style or the other; thus, if it starts with the comment-start sequence of style ``b'', it must also end with the comment-end sequence of style ``b''.
The two comment-start sequences must begin with the same character; only
the second character may differ. Mark the second character of the
``b''-style comment-start sequence with the b flag.
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:
/
124b
*
23
newline
>b
This defines four comment-delimiting sequences:
/*
*, does not have the b flag.
//
/, does have the b flag.
*/
*, does not have the b flag
newline
b flag.
p identifies an additional ``prefix character'' for Lisp syntax.
These characters are treated as whitespace when they appear between
expressions. When they appear within an expression, they are handled
according to their usual syntax codes.
The function backward-prefix-chars moves back over these
characters, as well as over characters whose primary syntax class is
prefix ('). See Motion and Syntax.