[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Font-lock of comments using comment tokens, does it work?
From: |
Björn Lindqvist |
Subject: |
Font-lock of comments using comment tokens, does it work? |
Date: |
Wed, 3 Jun 2015 18:46:55 +0200 |
Hello emacs,
I have a really complicated font-locking problem I'm trying to solve
for a major mode. It's like I've tried everything but nothing
works. Here is the question I asked on Stack Overflow and got some
help with but it didn't go all the way:
http://stackoverflow.com/questions/29973458/avoid-font-locking-interfering-inside-of-comments
I want to font-lock to understand that two short strings, e.g FOO and
BAR are the comment tokens. The tokens themselves should be
font-locked as comments and everything following them until the end of
line should also be comments.
The problem is that the strings only start comments if they are
free-standing tokens. So on these four lines there are comments:
random code FOO random comment
stuff BAR comment "with stuff"
BAR FOO BAR
FOO
On these four lines there are NO comments:
FOObar random come
BARFOO random code
random code xyFOOzw
random code "with string FOO " etc ...
Because the comment tokens are not separate. I'm suspecting that I've
found a limitation in emacs font-locking and that this is impossible
to get completely right. I'd love to be proven wrong though. :)
--
mvh/best regards Björn Lindqvist
- Font-lock of comments using comment tokens, does it work?,
Björn Lindqvist <=
- Re: Font-lock of comments using comment tokens, does it work?, Stefan Monnier, 2015/06/03
- Re: Font-lock of comments using comment tokens, does it work?, Björn Lindqvist, 2015/06/03
- Message not available
- Re: Font-lock of comments using comment tokens, does it work?, Stefan Monnier, 2015/06/03
- Re: Font-lock of comments using comment tokens, does it work?, Björn Lindqvist, 2015/06/04
- Message not available
- Re: Font-lock of comments using comment tokens, does it work?, Stefan Monnier, 2015/06/04
- Re: Font-lock of comments using comment tokens, does it work?, Björn Lindqvist, 2015/06/04
- Re: Font-lock of comments using comment tokens, does it work?, tomas, 2015/06/05
- Re: Font-lock of comments using comment tokens, does it work?, Björn Lindqvist, 2015/06/05
- Re: Font-lock of comments using comment tokens, does it work?, Björn Lindqvist, 2015/06/06
- Re: Font-lock of comments using comment tokens, does it work?, tomas, 2015/06/07