Skip to content

Instantly share code, notes, and snippets.

@buzztaiki
Last active August 26, 2025 04:24
Show Gist options
  • Save buzztaiki/ae126bfa3bdeb9b84e7a57bef43d6db2 to your computer and use it in GitHub Desktop.
Save buzztaiki/ae126bfa3bdeb9b84e7a57bef43d6db2 to your computer and use it in GitHub Desktop.
Emacs lisp syntax table cheat sheet

Emacs lisp syntax table cheat sheet

Syntax character Syntax class
or - Whitespace characters
w Word constituents
_ Symbol constituents
. Punctuation characters
(x Open parenthesis characters matches x
)x Close parenthesis characters matches x
" String quotes
\ Escape-syntax characters
/ Character quotes
$ Paired delimiters
' Expression prefixes
< Comment starters
> Comment enders
@ Inherit standard syntax
! Generic comment delimiters
| Generic string delimiters
Flag Description
1 2文字からなるコメント開始シーケンスの1文字目であることを示す。
2 2文字からなるコメント開始シーケンスの2文字目であることを示す。
3 2文字からなるコメント終了シーケンスの1文字目であることを示す。
4 2文字からなるコメント終了シーケンスの2文字目であることを示す。
b その文字が、オルタナティブな「b」コメントスタイルに属することを示す。2文字のコメントでは、開始シーケンスの2文字目と終了シーケンスの1文字目にのみ意味を持つ。
c その文字が、オルタナティブな「c」コメントスタイルに属することを示す。2文字のコメントでは、どちらかの文字にcフラグがあれば、そのコメントは「c」スタイルとなる。
n この種類のコメントがネスト可能であることを示す。2文字のコメントでは、どちらかの文字にnフラグがあれば、そのコメントはネスト可能となる。

カーソル位置のシンタックスを確認する

  • C-u M-x = (M-x describe-char)
  • (syntax-class-to-char (syntax-class (syntax-after (point))))
    • char-syntaxsyntax-table text propery を考慮しないから、buffer 内の文字については使わいな方が良い
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment