Elisp: Show Char's Syntax

By Xah Lee. Date: . Last updated: .

Show Char Syntax by Command

Alt+x describe-char

Show Char Syntax by Lisp Function

char-syntax

(char-syntax CHARACTER)

return a integer that is the Code Point of a char's Syntax Class code, of current buffer's syntax table.

CHARACTER is a integer. [see Elisp: Character Type]

🛑 WARNING: it does not check the character's syntax property in Text Properties

(char-syntax ?a)
;; 119 (#o167, #x77, ?w)

;; 119 is the codepoint for w
;; w is the code for syntax class of word
syntax-after

(syntax-after POS)

Return the raw syntax descriptor for the char after POS. If POS is outside the buffer's accessible portion, return nil.

Elisp, character and syntax table