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: Stefan Monnier
Subject: Re: Font-lock of comments using comment tokens, does it work?
Date: Wed, 03 Jun 2015 23:42:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> If you think you know what it should be changed to, can you tell me?

I don't know enough of the context to be sure.  Also, as Emacs
maintainer I have enough experience/knowledge to fix most users's
problems, but if I do that I'll just end up with more users with new
problems to fix.  So instead I'm better off trying to train them so they
can fix their problems themselves and even help me improve Emacs.

> I've tried a dozen different permutations of the regexp and none of
> them produces the desired result.

What have you tried?  What/where were the undesired results?

> I've also read the syntactic font-lock and syntax table sections of
> the manual several times and I still don't get it.

So you've covered the basics, good.
The thing you need to understand is that it all boils down to the
"syntax" given to the "!" character.  The default is set in the
buffer-local syntax-table, and this default is adjusted by
`syntax-table' text-properties which are applied via syntax-propertize.
So you can always go to a "!" and then hit C-u C-x = to see what is the
syntax of *this* particular "!" character, and whether that is the
desired syntax.  If it's not, then you can try
M-: (re-search-forward "theregexp" nil t) to see if the pattern you used
does match or doesn't match this char.


        Stefan


reply via email to

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