help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Font-lock of comments using comment tokens, does it work?


From: Björn Lindqvist
Subject: Re: Font-lock of comments using comment tokens, does it work?
Date: Sun, 7 Jun 2015 05:58:45 +0200

Ok so I finally almost figured it out. The key part was that you must
invert the logic so that instead of "unmarking" in
syntax-propertize-rules, you use a regexp that adds the comment
starter property "<" to the matched strings. Something is bugged with
the unmarking approach, it's like it stops looking when it found the
comment character. Anyway:

    (syntax-propertize-rules
       ("\\(^\\| \\|\t\\)\\(FOO\\|BAR\\)\\($\\| \\|\t\\)" (2 "<   ")))

Does almost exactly what I want. Amusingly enough the matching is
case-INsensitive so bAR, Bar, foo, etc matches the regexp. But it's a
small flaw which I can live with.


-- 
mvh/best regards Björn Lindqvist



reply via email to

[Prev in Thread] Current Thread [Next in Thread]