[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#16915: 24.3.50; [ruby-mode] Comments in regexps using the extended s
From: |
Stefan Monnier |
Subject: |
bug#16915: 24.3.50; [ruby-mode] Comments in regexps using the extended syntax are not font-locked properly |
Date: |
Wed, 12 Mar 2014 10:25:30 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> If we're speaking of multiple modes in general, syntax-ppss might not be
> enough to determine which keywords to highlight. Even if it includes
> information about new syntax classes.
It wouldn't really include info *about* new syntax classes, but the new
syntax class I suggest (which specifies a syntax-table to use) would
require changing the "parse-partial-sexp state" by keeping track of the
"current syntax-table".
"Syntax classes" are "events" which cause changes in the
parse-partial-sexp state machine, and syntax-ppss is a way to get the
state of that machine at a given position.
> Suppose we have an HTML file with <script> and <style> tags inside. Would
> points inside of these tags have different states?
Yes. E.g. (nth 10 (syntax-ppss)) would return a new "context" info
(which could just be "the syntax table to use in that area").
> Would some font-lock code compare syntax table reference attached
> to a syntax class, with a syntax table it wants?
Yes, quite possibly.
Stefan