Colin Rafferty writes:
> Hrvoje Niksic writes:
>> Insert this at the beginning of a fresh C buffer:
>> /* Sucks
>> (sucks
>> ...) something else */
>> Now go to end of buffer and press M-C-b. For me, this takes point to
>> the beginning of `else' instead of skipping the buffer.
> You will be (un)happy to know that every version since 19.11 has done
> this.
> And if you move the `(' off the BOL, everything works fine.
> The problem is not in C-mode per se, but deep in the depths of
> find_start_of_comment().
> 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. I guess I could remove it, rebuild, and see what breaks.
> I will.
I did. It works correctly, and everything else seems to be fine.
I have a feeling that this is very old and stale code that was cut and
pasted from a older function that used to search backwards for the
beginning of strings.
I do not know whether this patch should wait until 21.1, since it may
be thoroughly wrong. However, it looks to my eye like I just got rid
of some obsolete code.