It is possible to alter a character’s syntax table entry by storing a new number in the appropriate element of the syntax table, but it would be hard to determine what number to use. Emacs therefore provides a command that allows you to specify the syntactic properties of a character in a convenient way.
M-x modify-syntax-entry is the command to change a character’s syntax. It can be used interactively and is also used by major modes to initialize their own syntax tables. Its first argument is the character to change. The second argument is a string that specifies the new syntax. When called from Lisp code, there is a third, optional argument, which specifies the syntax table in which to make the change. If not supplied, or if this command is called interactively, the third argument defaults to the current buffer’s syntax table.
Flag this character as the first of a two-character comment starting sequence.
Flag this character as the second of a two-character comment starting sequence.
Flag this character as the first of a two-character comment ending sequence.
Flag this character as the second of a two-character comment ending sequence.
Use C-h s (
describe-syntax) to display a description of
the contents of the current syntax table. The description of each
character includes both the string you have to pass to
modify-syntax-entry to set up that character’s current syntax,
and some English to explain that string if necessary.