Hrvoje Niksic writes:
Colin Rafferty <craffert(a)ms.com> writes:
> > And if you move the `(' off the BOL, everything works
fine.
I noticed that. However, the reason I ask is that in the standard
GPL
comments a line begins with `(', so the expression pops up quite
often.
> > Line 526 of syntax.c decides that a character code type of
Sopen at
> > the beginning of the line means we are done looking, and the function
> > itself will then leave you at the end of the comment.
>
> > I guess the thing to do is figure out why the assumption at line 526
> > is there.
As Kyle pointed out, it's an optimization. For 21.1, someone
should
make measurements and see how fast/slow things work when the
optimization is removed.
I did not see Kyle's message. Kyle must have sent it to xemacs-review
(which I am not on).
I think that this is a false optimization. The only time that code is
correctly optimizing is if we are searching for the beginning of a
comment that has no beginning. Otherwise, it does nothing except
cause bugs.
The only other case where it may optimize something is in a language
where `comment-start' and `comment-end' are identical. I don't know a
language like that.
Again, it looks to me like a cut-and-paste from find_start_of_string
(which doesn't exist).
--
Colin