There is about 20 uses of this function. However, it can introduce subtle bugs, such as #851 because some modes use syntax-table property to annotate characters/points in special situations (to override the general syntax assigned to the character)
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.
So that in ruby foo? has the ? as part of the symbol with the syntax _ (symbol), but when it is somewhere on its own, it has syntax . (punctuation). Then if we test the character itself in isolation with char-syntax it always gives punctuation instead of what it should give based on the context.
There is about 20 uses of this function. However, it can introduce subtle bugs, such as #851 because some modes use
syntax-table
property to annotate characters/points in special situations (to override the general syntax assigned to the character)So that in ruby
foo?
has the ? as part of the symbol with the syntax_
(symbol), but when it is somewhere on its own, it has syntax.
(punctuation). Then if we test the character itself in isolation withchar-syntax
it always gives punctuation instead of what it should give based on the context.See also https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Table-Internals.html