Subject: Re: bug#15251: 24.3.50; do-auto-fill "continues" comment from inside a string

From: Dmitry Gutov <[email-masked]>
Date: Sun, 29 Sep 2013 18:16:29 +0300

Andreas Röhler <[email-masked]> writes:
> Reading the face for detecting basic things like comment is terrible.

It sure is. It can be justified for very hot functions, but otherwise
`syntax-ppss' does a better job in (more or less) constant time.

But that code was written in 2001, a few months before `syntax-ppss' was
introduced.

> What did the author smoke when writing this ;)

Let's ask him. :)

Stefan, can we consider `syntax-ppss' fast enough at this point?

It will mean re-implementing `comment-search-backward' in terms of it,
and removing most of the code in `comment-beginning' definition.

AFAICT, both of these functions are not particularly hot, and are called
once or twice per user action, at most.

`comment-search-backward' can also be made to respect
`comment-use-syntax' (and use its current definition if that var's value
is nil), but if comments don't have valid entries in the syntax table,
font-lock won't recognize them (or will it?), and then the dance with
face properties is not useful either.