Emacs lisp分号字符?

abo*_*abo 2 emacs elisp

真的,这是一个愚蠢的问题.我想要做

(position ?; "This is a test; or is it?")
Run Code Online (Sandbox Code Playgroud)

不幸的是,font-lock是基于regex的,因此它将代码的一部分作为注释突出显示.

处理这个问题的最佳方法是什么?此刻,我也有

(defconst semicolon (aref ";" 0))
(position semicolon "This is a test; or is it?")
Run Code Online (Sandbox Code Playgroud)

要么

(position 59 "This is a test; or is it?")
Run Code Online (Sandbox Code Playgroud)

gio*_*ano 7

你应该用反斜杠来转义分号:

(position ?\; "This is a test; or is it?")
Run Code Online (Sandbox Code Playgroud)