Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs lisp semicolon character?

Tags:

emacs

elisp

It's a silly question, really. I want to do

(position ?; "This is a test; or is it?")

Unfortunately, the font-lock is regex based, so it highlights a part of the code as a comment.

What's the best way to handle this? At the moment, I've got either

(defconst semicolon (aref ";" 0))
(position semicolon "This is a test; or is it?")

or

(position 59 "This is a test; or is it?")
like image 465
abo-abo Avatar asked Feb 17 '23 01:02

abo-abo


1 Answers

You should escape the semicolon with a backslash:

(position ?\; "This is a test; or is it?")
like image 56
giordano Avatar answered Feb 24 '23 14:02

giordano