[Top][All Lists]

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

Re: Clarification needed: syntax-propertize vs font-lock-syntax-table

From: Dmitry Gutov
Subject: Re: Clarification needed: syntax-propertize vs font-lock-syntax-table
Date: Fri, 20 Nov 2015 20:39:00 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0

On 11/20/2015 08:24 PM, Wedler, Christoph wrote:

And syntax-propertize should be called at more places.  Currently, doing
it lazily does not really work, as it is not called when needed.

You'll have to be more specific.

is why js-mode calls (syntax-propertize (point-max)) at the end (and I

Not anymore, it doesn't.

will do the same in antlr-mode).

I'd prefer if you didn't.

My other question was concerning (nth 9 ppss), i.e. the list of open
parentheses is very useful to have (and its also used in syntax.el
itself) -> I would like to have this to be official in the lisp
docstring as well - in src/syntax.c, we have

I thought that's exactly what you meant by documenting the 9th element. Were there any other options?

I'm not the guy who can say if it's okay or not. Probably is. But it would be sad if after that we choose a way to adapt syntax-ppss for the multiple-modes case, and it will require saving a more complex structure in the 9th element.

In the case of antlr-mode (grammar with actions), it could be done as
long as it does not break the calulation of the "inner-mode-chunk-end",
e.g, with Python actions

    rule: "KEYWORD" { do_something {  } # do it };

the action ends with the final "}" (even though a naive Python-like
syntax-propertization would think of it as part of a comment)

Yes, of course we should try to make it break as few things as possible. Not sure if I could comment on this in any more detail.

reply via email to

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